X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http.c;h=7cb3c4cdf8b6d06d880777c0cbd2679b490fbdcf;hp=b606bc3813c440ff726ec336ea80a75a5d063cac;hb=336ab37eb6fa1e0e91857d65fae0e747b4ad481c;hpb=a19a05825d04d634834f7898ec1a5247fdd6095c diff --git a/http.c b/http.c index b606bc3..7cb3c4c 100644 --- a/http.c +++ b/http.c @@ -35,6 +35,7 @@ #include "php_http.h" #include "php_http_api.h" #include "php_http_curl_api.h" +#include "php_http_std_defs.h" #ifdef ZEND_ENGINE_2 # include "ext/standard/php_http.h" @@ -368,6 +369,12 @@ zend_module_entry http_module_entry = { }; /* }}} */ + +static void free_to_free(void *s) +{ + efree(*(char **)s); +} + /* {{{ php_http_init_globals(zend_http_globals *) */ static void php_http_init_globals(zend_http_globals *http_globals) { @@ -380,6 +387,7 @@ static void php_http_init_globals(zend_http_globals *http_globals) http_globals->curlbuf.used = 0; http_globals->curlbuf.free = 0; http_globals->curlbuf.size = 0; + zend_llist_init(&http_globals->to_free, sizeof(char *), free_to_free, 0); #endif http_globals->allowed_methods = NULL; } @@ -470,6 +478,7 @@ PHP_RSHUTDOWN_FUNCTION(http) efree(HTTP_G(ctype)); HTTP_G(ctype) = NULL; } + #ifdef HTTP_HAVE_CURL if (HTTP_G(curlbuf).data) { efree(HTTP_G(curlbuf).data); @@ -478,6 +487,7 @@ PHP_RSHUTDOWN_FUNCTION(http) HTTP_G(curlbuf).free = 0; } #endif + return SUCCESS; } /* }}} */