From: Frederic Lecaille Date: Fri, 20 Feb 2026 11:12:10 +0000 (+0100) Subject: BUG/MINOR: haterm: missing allocation check in copy_argv() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db360d466ba6f3e3d34212cf0c77ce099d96b670;p=thirdparty%2Fhaproxy.git BUG/MINOR: haterm: missing allocation check in copy_argv() This is a very minor bug with a very low probability of occurring. However, it could be flagged by a static analyzer or result in a small contribution, which is always time-consuming for very little gain. --- diff --git a/src/haterm_init.c b/src/haterm_init.c index 1eacd900e..65baad54f 100644 --- a/src/haterm_init.c +++ b/src/haterm_init.c @@ -474,6 +474,9 @@ void haproxy_init_args(int argc, char **argv) char **copy_argv(int argc, char **argv) { char **ret = calloc(1, sizeof(*ret)); - *ret = strdup(""); + + if (*ret) + *ret = strdup(""); + return ret; }