From: Kurt Zeilenga Date: Fri, 5 Feb 1999 23:46:03 +0000 (+0000) Subject: Don't call idl_free() unless necessary. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~623 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dde7e3dfa61c6d1e718a57b126121af71f90599a;p=openldap Don't call idl_free() unless necessary. --- diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 9ac95992d9..18279f2143 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -168,19 +168,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 ); @@ -203,7 +204,10 @@ add_value( if ( tmpval != NULL ) { free( tmpval ); } - idl_free( idl ); + + if( idl != NULL ) { + idl_free( idl ); + } ldap_pvt_thread_yield();