Fix memory leak in str2entry

This commit is contained in:
Howard Chu 2001-12-27 10:25:50 +00:00
parent cddf7e0e00
commit 102cb93220

View File

@ -139,6 +139,7 @@ str2entry( char *s )
} }
rc = dnPretty( NULL, &value, &pdn ); rc = dnPretty( NULL, &value, &pdn );
free( value.bv_val );
if( rc != LDAP_SUCCESS ) { if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: " LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: "
@ -151,7 +152,6 @@ str2entry( char *s )
(long) e->e_id, (long) e->e_id,
pdn->bv_val ? pdn->bv_val : "", 0 ); pdn->bv_val ? pdn->bv_val : "", 0 );
#endif #endif
if( value.bv_val != NULL ) free( value.bv_val );
entry_free( e ); entry_free( e );
return NULL; return NULL;
} }