From 9029c0902f323c0f92622b9f3019e115d4607878 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 16 Aug 2007 11:32:10 +0000 Subject: [PATCH] don't trick coverity... --- servers/slapd/attr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 ); -- 2.39.5