summaryrefslogtreecommitdiff
path: root/ext/ldap/ldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ldap/ldap.c')
-rw-r--r--ext/ldap/ldap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 60436e5b05..01bdc267e1 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -1912,8 +1912,11 @@ PHP_FUNCTION(ldap_modify_batch)
oper = LDAP_MOD_REPLACE;
break;
default:
- php_error_docref(NULL, E_ERROR, "Unknown and uncaught modification type.");
- RETURN_FALSE;
+ zend_throw_error(NULL, "Unknown and uncaught modification type.");
+ RETVAL_FALSE;
+ efree(ldap_mods[i]);
+ num_mods = i;
+ goto cleanup;
}
/* fill in the basic info */
@@ -1958,7 +1961,7 @@ PHP_FUNCTION(ldap_modify_batch)
} else RETVAL_TRUE;
/* clean up */
- {
+ cleanup: {
for (i = 0; i < num_mods; i++) {
/* attribute */
efree(ldap_mods[i]->mod_type);