Skip to content

Commit e45b613

Browse files
committed
Free buffer in php_verror even if it is empty
vspprintf allocates a buffer even if the resulting string is empty.
1 parent fcdc0a6 commit e45b613

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

main/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,9 +1132,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
11321132
if (replace_buffer) {
11331133
zend_string_free(replace_buffer);
11341134
} else {
1135-
if (buffer_len > 0) {
1136-
efree(buffer);
1137-
}
1135+
efree(buffer);
11381136
}
11391137

11401138
php_error(type, "%s", message);

0 commit comments

Comments
 (0)