]> git.sur5r.net Git - openldap/commitdiff
Fix memory leak in str2entry
authorHoward Chu <hyc@openldap.org>
Thu, 27 Dec 2001 10:25:50 +0000 (10:25 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 27 Dec 2001 10:25:50 +0000 (10:25 +0000)
servers/slapd/entry.c

index 78ca41f9af6f62ee41d7ee65fc3aab26466759ca..afc4272132759e7133ac52ad80e5446e4bb9dbb8 100644 (file)
@@ -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;
                        }