fix leak with vararg zend_parse_parameters
authorMichael Wallner <mike@php.net>
Wed, 12 Dec 2012 18:14:54 +0000 (18:14 +0000)
committerMichael Wallner <mike@php.net>
Wed, 12 Dec 2012 18:14:54 +0000 (18:14 +0000)
php_http_client_factory.c

index 1b14f481dac82a2592f3ed056b808ed33a8e8cc6..87c4419eb09c2e07ec8542a4cbba9c86630a14fd 100644 (file)
@@ -228,6 +228,10 @@ PHP_METHOD(HttpClientFactory, createPool)
                                        php_http_error(HE_WARNING, PHP_HTTP_E_REQUEST_FACTORY, "pools are not supported by this driver");
                                }
                        } end_error_handling();
+                       
+                       if (argv) {
+                               efree(argv);
+                       }
                }
        } end_error_handling();
 }
@@ -235,7 +239,7 @@ PHP_METHOD(HttpClientFactory, createPool)
 PHP_METHOD(HttpClientFactory, createDataShare)
 {
        int argc = 0;
-       zval ***argv;
+       zval ***argv = NULL;
 
        with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
                if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &argv, &argc)) {
@@ -289,6 +293,9 @@ PHP_METHOD(HttpClientFactory, createDataShare)
                                        php_http_error(HE_WARNING, PHP_HTTP_E_REQUEST_FACTORY, "datashares are not supported by this driver");
                                }
                        } end_error_handling();
+                       if (argv) {
+                               efree(argv);
+                       }
                }
        } end_error_handling();
 }