diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-07-05 02:08:39 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-07-05 02:08:39 -0500 |
commit | 24237027bc7e4f7aed9287fe9815c0577eeb1c22 (patch) | |
tree | bc23b05ba89a75f0e0711933371f708b96e63345 /ext/ldap/ldap.c | |
parent | 42666da1714673d537356221e688f57f404fe1d2 (diff) | |
parent | e9832b5ab1d986ddd3ea0705bcbc5a391dc16614 (diff) | |
download | php-git-24237027bc7e4f7aed9287fe9815c0577eeb1c22.tar.gz |
Merge branch 'throw-error-in-extensions'
Diffstat (limited to 'ext/ldap/ldap.c')
-rw-r--r-- | ext/ldap/ldap.c | 9 |
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); |