]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ot: removed dead code in flt_ot_parse_cfg_str()
authorMiroslav Zagorac <mzagorac@haproxy.com>
Wed, 18 Jan 2023 16:14:16 +0000 (17:14 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Apr 2026 07:23:30 +0000 (09:23 +0200)
The local variable str was declared but never assigned a value other than
NULL.  The error-handling block that called flt_ot_conf_str_free(&str) on
it was therefore a no-op.  Removed both the unused variable and the dead
cleanup path.

addons/ot/src/parser.c

index 0f8fc5495f3e42332ed421093e361f03d1a558a7..e067501cd5dd15ef93925e6b331eda9c02a70722 100644 (file)
@@ -359,8 +359,7 @@ static int flt_ot_parse_cfg_sample(const char *file, int linenum, char **args, s
  */
 static int flt_ot_parse_cfg_str(const char *file, int linenum, char **args, struct list *head, char **err)
 {
-       struct flt_ot_conf_str *str = NULL;
-       int                     i, retval = ERR_NONE;
+       int i, retval = ERR_NONE;
 
        FLT_OT_FUNC("\"%s\", %d, %p, %p, %p:%p", file, linenum, args, head, FLT_OT_DPTR_ARGS(err));
 
@@ -368,9 +367,6 @@ static int flt_ot_parse_cfg_str(const char *file, int linenum, char **args, stru
                if (flt_ot_conf_str_init(args[i], linenum, head, err) == NULL)
                        retval |= ERR_ABORT | ERR_ALERT;
 
-       if (retval & ERR_CODE)
-               flt_ot_conf_str_free(&str);
-
        FLT_OT_RETURN_INT(retval);
 }