From: Michael Wallner Date: Wed, 28 Apr 2010 06:53:08 +0000 (+0000) Subject: fix memleak X-Git-Tag: RELEASE_1_7_0~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=8fb7d5e06e0fb4252831ecb5a3b87d0279363119;p=m6w6%2Fext-http fix memleak --- diff --git a/http_message_object.c b/http_message_object.c index 60fd8df..8d1e847 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -1124,10 +1124,11 @@ PHP_METHOD(HttpMessage, setHttpVersion) convert_to_double(zv); spprintf(&version, 0, "%1.1F", Z_DVAL_P(zv)); if (strcmp(version, "1.0") && strcmp(version, "1.1")) { - http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %s", version); + efree(version); + http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %g", Z_DVAL_P(zv)); RETURN_FALSE; } - + efree(version); obj->message->http.version = Z_DVAL_P(zv); RETURN_TRUE; }