/* }}} */
/* {{{ 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;
}
}
/* }}} */
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;
}
/* }}} */
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);