From: Pierangelo Masarati Date: Thu, 16 Aug 2007 11:32:10 +0000 (+0000) Subject: don't trick coverity... X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~206 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9029c0902f323c0f92622b9f3019e115d4607878;p=openldap don't trick coverity... --- diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 4e418e3032..315442466f 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -185,9 +185,10 @@ comp_tree_free( Attribute *a ) void attrs_free( Attribute *a ) { - Attribute *b, *tail, *next; - if ( a ) { + Attribute *b = (Attribute *)0xBAD, *tail, *next; + + /* save tail */ tail = a; do { next = a->a_next; @@ -198,6 +199,8 @@ attrs_free( Attribute *a ) } while ( next ); ldap_pvt_thread_mutex_lock( &attr_mutex ); + /* replace NULL with current attr list and let attr list + * start from last attribute returned to list */ tail->a_next = attr_list; attr_list = b; ldap_pvt_thread_mutex_unlock( &attr_mutex );