]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: Fix memleak in xtopt_parse_hostmask()
authorPhil Sutter <phil@nwl.cc>
Wed, 2 Jun 2021 09:04:30 +0000 (11:04 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 7 Jun 2021 12:50:27 +0000 (14:50 +0200)
The allocated hostmask duplicate needs to be freed again.

Fixes: 66266abd17adc ("libxtables: XTTYPE_HOSTMASK support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
libxtables/xtoptions.c

index d329f2ff7979e590d1b9ac217c93b6616711bebc..0dcdf607f46782615dba7a26ff2b65be66d67c75 100644 (file)
@@ -763,6 +763,7 @@ static void xtopt_parse_hostmask(struct xt_option_call *cb)
        cb->arg = p;
        xtopt_parse_plenmask(cb);
        cb->arg = orig_arg;
+       free(work);
 }
 
 static void xtopt_parse_ethermac(struct xt_option_call *cb)