From: Pierangelo Masarati Date: Mon, 3 Mar 2003 21:32:58 +0000 (+0000) Subject: set return code X-Git-Tag: NO_SLAP_OP_BLOCKS~197 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd41bb1a06810a7a76c777faa44f6fa0e619da1f;p=openldap set return code --- diff --git a/servers/slapd/back-ldap/modify.c b/servers/slapd/back-ldap/modify.c index dc10dfe461..1db0e88d00 100644 --- a/servers/slapd/back-ldap/modify.c +++ b/servers/slapd/back-ldap/modify.c @@ -107,10 +107,12 @@ ldap_back_modify( mods = (LDAPMod *)ch_malloc(i*sizeof(LDAPMod)); if (mods == NULL) { + rc = LDAP_NO_MEMORY; goto cleanup; } modv = (LDAPMod **)ch_malloc((i+1)*sizeof(LDAPMod *)); if (modv == NULL) { + rc = LDAP_NO_MEMORY; goto cleanup; } @@ -167,10 +169,12 @@ cleanup:; #ifdef ENABLE_REWRITE } #endif /* ENABLE_REWRITE */ - for (i=0; modv[i]; i++) + for (i=0; modv[i]; i++) { ch_free(modv[i]->mod_bvalues); - ch_free(mods); - ch_free(modv); - return( ldap_back_op_result( li, lc, conn, op, msgid, rc, 1 )); + } + ch_free( mods ); + ch_free( modv ); + + return ldap_back_op_result( li, lc, conn, op, msgid, rc, 1 ); }