summaryrefslogtreecommitdiff
path: root/ext/ldap
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2002-10-30 18:12:34 +0000
committerIlia Alshanetsky <iliaa@php.net>2002-10-30 18:12:34 +0000
commit433261281241adc7b090f0cf945f887ecd3f4f80 (patch)
treef8f8d6961ef413a70b297c561831604d0c63bcbf /ext/ldap
parent536c34ebc975e1f27645e1410465e387d9ca8e75 (diff)
downloadphp-git-433261281241adc7b090f0cf945f887ecd3f4f80.tar.gz
Fixed a memory leak on ldap_connect() failure.
Diffstat (limited to 'ext/ldap')
-rw-r--r--ext/ldap/ldap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 7c38088a45..edff9b6ce0 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -387,6 +387,7 @@ PHP_FUNCTION(ldap_connect)
rc = ldap_initialize(&ldap, host);
if (rc != LDAP_SUCCESS) {
+ efree(ld);
php_error(E_WARNING, "%s(): Could not create session handle: %s", get_active_function_name(TSRMLS_C), ldap_err2string(rc));
RETURN_FALSE;
}
@@ -398,11 +399,13 @@ PHP_FUNCTION(ldap_connect)
#endif
if ( ldap == NULL ) {
+ efree(ld);
RETURN_FALSE;
} else {
#ifdef HAVE_ORALDAP
if (ssl) {
if (ldap_init_SSL(&ldap->ld_sb, wallet, walletpasswd, authmode)) {
+ efree(ld);
php_error(E_WARNING, "%s(): SSL init failed", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}