From e977628e35724250cef163c65754d4f1a659cd84 Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Mon, 17 Aug 2009 19:41:23 +0000 Subject: [PATCH] ITS#6256 --- CHANGES | 1 + servers/slapd/syncrepl.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 0a2ce4144f..2352062971 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ OpenLDAP 2.4.18 Engineering Fixed slapd with duplicate empty lines for olcDbConfig (ITS#6240) Fixed slapd server URL matching (ITS#5942) Fixed slapd subordinate needs a suffix (ITS#6216) + Fixed slapd syncrepl decrement on possible NULL value (ITS#6256) Fixed slapd tools to properly close database (ITS#6214) Fixed slapd uninitialized SlapReply components (ITS#6101) Fixed slapd-meta starttls with targets (ITS#6190) 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