From e45b613950d17b9a3d510dcc9a39c32117ecc081 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 17 Dec 2019 16:44:17 +0100 Subject: [PATCH] Free buffer in php_verror even if it is empty vspprintf allocates a buffer even if the resulting string is empty. --- main/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main/main.c b/main/main.c index 7890b2ebeb1..e1491db1fd1 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);