mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-09 09:01:51 +01:00
CLEANUP: http-htx: Set buffer area to NULL instead of malloc(0)
During error files conversion to HTX message, in http_str_to_htx(), if a file is empty, the corresponding buffer's area is initialized with a malloc(0) and its size is set to 0. There is no problem here. The behaviour is totally defined. But it is not really intuitive. Instead, we can simply set the area to NULL. This patch should fix the issue #1022.
This commit is contained in:
parent
f09612289f
commit
1cdc028687
@ -904,7 +904,7 @@ int http_str_to_htx(struct buffer *buf, struct ist raw, char **errmsg)
|
||||
b_reset(buf);
|
||||
if (!raw.len) {
|
||||
buf->size = 0;
|
||||
buf->area = malloc(raw.len);
|
||||
buf->area = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user