]> git.sur5r.net Git - openldap/commitdiff
ITS#6256 from Jonathan Clarke
authorHoward Chu <hyc@openldap.org>
Sat, 15 Aug 2009 14:05:47 +0000 (14:05 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 15 Aug 2009 14:05:47 +0000 (14:05 +0000)
servers/slapd/syncrepl.c

index 627e43a3d2e5458d9f46fea7121e4e10ce2937de..35e431f6dd76d8b7881381aeaf43258a72db6165 100644 (file)
@@ -3729,12 +3729,14 @@ syncinfo_free( syncinfo_t *sie, int free_all )
                        }
                        ch_free( npe );
                }
-               sie->si_cookieState->cs_ref--;
-               if ( !sie->si_cookieState->cs_ref ) {
-                       ch_free( sie->si_cookieState->cs_sids );
-                       ber_bvarray_free( sie->si_cookieState->cs_vals );
-                       ldap_pvt_thread_mutex_destroy( &sie->si_cookieState->cs_mutex );
-                       ch_free( sie->si_cookieState );
+               if ( sie->si_cookieState ) {
+                       sie->si_cookieState->cs_ref--;
+                       if ( !sie->si_cookieState->cs_ref ) {
+                               ch_free( sie->si_cookieState->cs_sids );
+                               ber_bvarray_free( sie->si_cookieState->cs_vals );
+                               ldap_pvt_thread_mutex_destroy( &sie->si_cookieState->cs_mutex );
+                               ch_free( sie->si_cookieState );
+                       }
                }
                ch_free( sie );
                sie = si_next;