mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
BUG/MINOR: standard: Avoid free of non-allocated pointer
The original author forgot to dereference the argument to free in parse_binary. This may result in a crash on reading bad input from the configuration file instead of a proper error message. Found in HAProxy 1.5.14.
This commit is contained in:
parent
776e518caf
commit
93f91c3082
@ -2052,8 +2052,10 @@ int parse_binary(const char *source, char **binstr, int *binstrlen, char **err)
|
||||
|
||||
bad_input:
|
||||
memprintf(err, "an hex digit is expected (found '%c')", p[i-1]);
|
||||
if (alloc)
|
||||
free(binstr);
|
||||
if (alloc) {
|
||||
free(*binstr);
|
||||
*binstr = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user