From: Howard Chu Date: Thu, 27 Dec 2001 10:25:50 +0000 (+0000) Subject: Fix memory leak in str2entry X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~457 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=102cb932209b8fbdfd29ecb4f1b4101e7dd407c2;p=openldap Fix memory leak in str2entry --- diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index 78ca41f9af..afc4272132 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -139,6 +139,7 @@ str2entry( char *s ) } rc = dnPretty( NULL, &value, &pdn ); + free( value.bv_val ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: " @@ -151,7 +152,6 @@ str2entry( char *s ) (long) e->e_id, pdn->bv_val ? pdn->bv_val : "", 0 ); #endif - if( value.bv_val != NULL ) free( value.bv_val ); entry_free( e ); return NULL; }