]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: config: use free_args() to release args array in cfg_eval_condition()
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Jul 2021 08:26:09 +0000 (10:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Jul 2021 17:18:41 +0000 (19:18 +0200)
Doing so is cleaner than open-coding it and will support future extensions.

src/cfgparse.c

index 5e21467951d634ecca9defa59c03ff1c893ff170..a1b9a47640e970ec3dd7da1e6f25f8bdcf2f0454 100644 (file)
@@ -1827,11 +1827,8 @@ int cfg_eval_condition(char **args, char **err, const char **errptr)
        if (errptr)
                *errptr = args[0];
  done:
-       for (nbargs = 0; argp && argp[nbargs].type != ARGT_STOP; nbargs++) {
-               if (argp[nbargs].type == ARGT_STR)
-                       free(argp[nbargs].data.str.area);
-       }
-       free(argp);
+       free_args(argp);
+       ha_free(&argp);
        return ret;
 }