Fixed Bug #69998 curl multi leaking memory
authorPierrick Charron <pierrick@webstart.fr>
Sat, 1 Aug 2015 18:22:36 +0000 (14:22 -0400)
committerPierrick Charron <pierrick@webstart.fr>
Sat, 1 Aug 2015 18:55:00 +0000 (14:55 -0400)
Fix the pointer address passed to the comparator and call
zend_list_delete instead of zend_list_close to avoid closing
the resource if still used.

NEWS
ext/curl/multi.c

diff --git a/NEWS b/NEWS
index 5ad80828601002a27bca74d8cccbcacef0af58e4..7d0169d2266993924dc4b3631089fb1c806b43fa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ PHP                                                                        NEWS
 
 - IMAP:
   . Fixed bug #70158 (Building with static imap fails). (cmb)
+  . Fixed bug #69998 (curl multi leaking memory). (Pierrick)
 
 - Opcache:
   . Fixed bug #70111 (Segfault when a function uses both an explicit return
index d5916d6f581d7798508bddbb6b17f05175e95edb..8f52b24a379abfc2f30d3e451bdb0092df7b2d57 100644 (file)
@@ -116,7 +116,7 @@ void _php_curl_multi_cleanup_list(void *data) /* {{{ */
                return;
        }
 
-       zend_list_close(Z_RES_P(z_ch));
+       zend_list_delete(Z_RES_P(z_ch));
 }
 /* }}} */
 
@@ -151,7 +151,7 @@ PHP_FUNCTION(curl_multi_remove_handle)
        }
 
        RETVAL_LONG((zend_long)curl_multi_remove_handle(mh->multi, ch->cp));
-       zend_llist_del_element(&mh->easyh, &z_ch, (int (*)(void *, void *))curl_compare_resources);
+       zend_llist_del_element(&mh->easyh, z_ch, (int (*)(void *, void *))curl_compare_resources);
 
 }
 /* }}} */