From e9e63f922303d852b6899cadd68d7ec73e8f6134 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 30 Sep 2013 11:23:33 +0200 Subject: [PATCH 1/2] fix memleak on resetting rebind_proc --- ext/ldap/ldap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3cfa2092e77..71d57d6d9b9 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2107,6 +2107,7 @@ PHP_FUNCTION(ldap_set_rebind_proc) /* unregister rebind procedure */ if (ld->rebindproc != NULL) { zval_dtor(ld->rebindproc); + FREE_ZVAL(ld->rebindproc); ld->rebindproc = NULL; ldap_set_rebind_proc(ld->link, NULL, NULL); } From 2b78edfba25afac8f34ca65e18f98d23a4b8bcce Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 30 Sep 2013 11:41:35 +0200 Subject: [PATCH 2/2] fix test --- ext/ldap/tests/ldap_search_variation6.phpt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ext/ldap/tests/ldap_search_variation6.phpt b/ext/ldap/tests/ldap_search_variation6.phpt index a29e4524df4..5139ebb77de 100644 --- a/ext/ldap/tests/ldap_search_variation6.phpt +++ b/ext/ldap/tests/ldap_search_variation6.phpt @@ -217,14 +217,26 @@ array(2) { [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} array(2) { [0]=> resource(%d) of type (ldap result) [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} ===DONE===