From 598ef9e685437dd88779de09179abbd948b06626 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 30 Dec 2006 12:47:17 +0000 Subject: [PATCH] Fix prev commit --- servers/slapd/attr.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 3c397c64f2..a3b9737096 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -187,15 +187,17 @@ attrs_free( Attribute *a ) { Attribute *b; - for(b = a ; b != NULL ; b = b->a_next ) { - attr_clean( b ); - if ( !b->a_next ) - break; + if ( a ) { + for(b = a ; ; b = b->a_next ) { + attr_clean( b ); + if ( !b->a_next ) + break; + } + ldap_pvt_thread_mutex_lock( &attr_mutex ); + b->a_next = attr_list; + attr_list = a; + ldap_pvt_thread_mutex_unlock( &attr_mutex ); } - ldap_pvt_thread_mutex_lock( &attr_mutex ); - b->a_next = attr_list; - attr_list = a; - ldap_pvt_thread_mutex_unlock( &attr_mutex ); } static void -- 2.39.5