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:
BiancaDogareci 2026-04-25 15:00:37 +03:00 committed by William Lallemand
parent 90bfbea7c0
commit fa17a50c62

View File

@ -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;