From: Howard Chu Date: Wed, 12 Mar 2003 13:05:19 +0000 (+0000) Subject: #ifndef SLAP_NVALUES asserted berval was leaked X-Git-Tag: NO_SLAP_OP_BLOCKS~137 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6aab531d66ae25a2c594e7dfda2cdf2d5933c047;p=openldap #ifndef SLAP_NVALUES asserted berval was leaked --- diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index 946aa1b2a7..73aac72e39 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -416,10 +416,9 @@ modify_add_values( if ( mod->sm_bvalues[1].bv_val == 0 ) { if ( a != NULL ) { - struct berval asserted; int i; - #ifndef SLAP_NVALUES + struct berval asserted; rc = value_normalize( mod->sm_desc, SLAP_MR_EQUALITY, &mod->sm_bvalues[ 0 ], &asserted, text ); if ( rc != LDAP_SUCCESS ) { @@ -463,7 +462,9 @@ modify_add_values( matched++; continue; } +#ifndef SLAP_NVALUES free( asserted.bv_val ); +#endif *text = textbuf; snprintf( textbuf, textlen, "modify/%s: %s: value #0 already exists", @@ -471,6 +472,9 @@ modify_add_values( return LDAP_TYPE_OR_VALUE_EXISTS; } } +#ifndef SLAP_NVALUES + free( asserted.bv_val ); +#endif if ( permissive && matched == i ) { /* values already exist; do nothing */ return LDAP_SUCCESS;