From: Nikita Popov Date: Tue, 17 Dec 2019 15:44:17 +0000 (+0100) Subject: Free buffer in php_verror even if it is empty X-Git-Tag: php-7.4.7RC1~415 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e45b613950d17b9a3d510dcc9a39c32117ecc081;p=php Free buffer in php_verror even if it is empty vspprintf allocates a buffer even if the resulting string is empty. --- diff --git a/main/main.c b/main/main.c index 7890b2ebeb..e1491db1fd 100644 --- a/main/main.c +++ b/main/main.c @@ -1132,9 +1132,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ if (replace_buffer) { zend_string_free(replace_buffer); } else { - if (buffer_len > 0) { - efree(buffer); - } + efree(buffer); } php_error(type, "%s", message);