diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-10-30 18:12:34 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-10-30 18:12:34 +0000 |
commit | 433261281241adc7b090f0cf945f887ecd3f4f80 (patch) | |
tree | f8f8d6961ef413a70b297c561831604d0c63bcbf /ext/ldap | |
parent | 536c34ebc975e1f27645e1410465e387d9ca8e75 (diff) | |
download | php-git-433261281241adc7b090f0cf945f887ecd3f4f80.tar.gz |
Fixed a memory leak on ldap_connect() failure.
Diffstat (limited to 'ext/ldap')
-rw-r--r-- | ext/ldap/ldap.c | 3 |
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; } |