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.
This commit is contained in:
Frederic Lecaille 2026-02-20 12:12:10 +01:00
parent 92581043fb
commit db360d466b

View File

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