From: Howard Chu Date: Sat, 15 Aug 2009 14:05:47 +0000 (+0000) Subject: ITS#6256 from Jonathan Clarke X-Git-Tag: ACLCHECK_0~329 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f918243a2f9b0b6fd553454d90bf624cfb1d9760;p=openldap ITS#6256 from Jonathan Clarke --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 627e43a3d2..35e431f6dd 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -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;