mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-02 19:51:00 +02:00
BUG/MINOR: ssl: fix memory leak on realloc failure in acme.ips
Fix a realloc() bug in ckchs_dup() when copying the acme.ips array, where overwriting the original pointer with NULL on allocation failure loses reference to the original memory block. Use my_realloc2() which safely handles the failure. No backport needed.
This commit is contained in:
parent
90bfbea7c0
commit
fa17a50c62
@ -1119,7 +1119,7 @@ struct ckch_store *ckchs_dup(const struct ckch_store *src)
|
||||
/* copy the array of IP strings */
|
||||
|
||||
while (src->conf.acme.ips[n]) {
|
||||
r = realloc(r, sizeof(char *) * (n + 2));
|
||||
r = my_realloc2(r, sizeof(char *) * (n + 2));
|
||||
if (!r)
|
||||
goto error;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user