From: Kurt Zeilenga Date: Fri, 5 Feb 1999 23:44:32 +0000 (+0000) Subject: Don't call idl_free() unless necessary. X-Git-Tag: OPENLDAP_REL_ENG_1_2_0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61c76258645b28bb880550217a30634bc86a39e8;p=thirdparty%2Fopenldap.git Don't call idl_free() unless necessary. --- diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index b87bf51c2e..45a8a7eb1c 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -166,19 +166,20 @@ add_value( { int rc; Datum key; - ID_BLOCK *idl; - char prefix; - char *realval, *tmpval, *s; + ID_BLOCK *idl = NULL; + char *tmpval = NULL; + char *realval = val; char buf[BUFSIZ]; + char prefix = index2prefix( indextype ); + ldbm_datum_init( key ); - prefix = index2prefix( indextype ); Debug( LDAP_DEBUG_TRACE, "=> add_value( \"%c%s\" )\n", prefix, val, 0 ); realval = val; tmpval = NULL; - idl = NULL; + if ( prefix != UNKNOWN_PREFIX ) { unsigned int len = strlen( val ); @@ -201,7 +202,10 @@ add_value( if ( tmpval != NULL ) { free( tmpval ); } - idl_free( idl ); + + if( idl != NULL ) { + idl_free( idl ); + } ldap_pvt_thread_yield();