From: Kurt Zeilenga Date: Thu, 16 May 2002 15:45:24 +0000 (+0000) Subject: From: h.b.furuseth@usit.uio.no X-Git-Tag: OPENLDAP_REL_ENG_2_MP~54 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3abec7d8d772c0a15a7adb0247e9f3574c2203f3;p=openldap From: h.b.furuseth@usit.uio.no Patch: str2entry() dereferences NULL (ITS#1822) Sorry, last patch was wrong. I didn't notice that e->e_dn always is NULL at that point. Here is a corrected patch. --- diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index b30598fab3..8a1106e974 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -129,22 +129,21 @@ str2entry( char *s ) } rc = dnPrettyNormal( NULL, &vals[0], &e->e_name, &e->e_nname ); - free( vals[0].bv_val ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: " "entry %ld has invalid DN \"%s\"\n", - (long) e->e_id, - e->e_dn ? e->e_dn : "" )); + (long) e->e_id, vals[0].bv_val )); #else Debug( LDAP_DEBUG_ANY, "str2entry: " "entry %ld has invalid DN \"%s\"\n", - (long) e->e_id, - e->e_dn ? e->e_dn : "", 0 ); + (long) e->e_id, vals[0].bv_val, 0 ); #endif entry_free( e ); + free( vals[0].bv_val ); return NULL; } + free( vals[0].bv_val ); continue; }