fix memleak
authorMichael Wallner <mike@php.net>
Wed, 28 Apr 2010 06:53:08 +0000 (06:53 +0000)
committerMichael Wallner <mike@php.net>
Wed, 28 Apr 2010 06:53:08 +0000 (06:53 +0000)
http_message_object.c

index 60fd8dfafddf2e9ef971381fa727c16d28e375ab..8d1e8470678c55ce4eb3266d5df2b5adae697759 100644 (file)
@@ -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;
 }