From f918243a2f9b0b6fd553454d90bf624cfb1d9760 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 15 Aug 2009 14:05:47 +0000 Subject: [PATCH] ITS#6256 from Jonathan Clarke --- servers/slapd/syncrepl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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; -- 2.39.5