From: Michael Wallner Date: Thu, 8 Dec 2005 21:59:28 +0000 (+0000) Subject: - http_request_body_free() should only accept a ptr_ptr X-Git-Tag: RELEASE_0_20_0~41 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=11ab01d7187d849bff12366a11174df582ce9657;p=m6w6%2Fext-http - http_request_body_free() should only accept a ptr_ptr --- diff --git a/http_request_api.c b/http_request_api.c index e9d39d7..f02aa18 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -374,11 +374,12 @@ PHP_HTTP_API void _http_request_body_dtor(http_request_body *body TSRMLS_DC) /* }}} */ /* {{{ void http_request_body_free(http_request_body *) */ -PHP_HTTP_API void _http_request_body_free(http_request_body *body TSRMLS_DC) +PHP_HTTP_API void _http_request_body_free(http_request_body **body TSRMLS_DC) { - if (body) { - http_request_body_dtor(body); - efree(body); + if (*body) { + http_request_body_dtor(*body); + efree(*body); + *body = NULL; } } /* }}} */ diff --git a/http_request_pool_api.c b/http_request_pool_api.c index 48cf18c..2a297d6 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -384,8 +384,9 @@ void _http_request_pool_wrap_exception(zval *old_exception, zval *new_exception static void http_request_pool_freebody(http_request_callback_ctx **body) { HTTP_REQUEST_CALLBACK_DATA(*body, http_request_body *, b); - http_request_body_free(b); + http_request_body_free(&b); efree(*body); + *body = NULL; } /* }}} */ diff --git a/php_http_request_api.h b/php_http_request_api.h index 7d9a4c7..2da5f22 100644 --- a/php_http_request_api.h +++ b/php_http_request_api.h @@ -80,7 +80,7 @@ PHP_HTTP_API STATUS _http_request_body_fill(http_request_body *body, HashTable * PHP_HTTP_API void _http_request_body_dtor(http_request_body *body TSRMLS_DC); #define http_request_body_free(b) _http_request_body_free((b) TSRMLS_CC) -PHP_HTTP_API void _http_request_body_free(http_request_body *body TSRMLS_DC); +PHP_HTTP_API void _http_request_body_free(http_request_body **body TSRMLS_DC); #define http_request_init(ch, meth, url, body, options) _http_request_init((ch), (meth), (url), (body), (options) TSRMLS_CC) PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char *url, http_request_body *body, HashTable *options TSRMLS_DC);