diff mbox series

[iptables,3/9] libxtables: Fix memleak in xtopt_parse_hostmask()

Message ID 20210602152403.5689-4-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series Fix a bunch of static analyzer warnings | expand

Commit Message

Phil Sutter June 2, 2021, 3:23 p.m. UTC
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 | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c
index d329f2ff7979e..0dcdf607f4678 100644
--- a/libxtables/xtoptions.c
+++ b/libxtables/xtoptions.c
@@ -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)