Blame SOURCES/0007-libxtables-Fix-memleak-in-xtopt_parse_hostmask.patch

3a00e5
From eece041510effa3359135f92714cfa4012bd8922 Mon Sep 17 00:00:00 2001
3a00e5
From: Phil Sutter <phil@nwl.cc>
3a00e5
Date: Wed, 2 Jun 2021 11:04:30 +0200
3a00e5
Subject: [PATCH] libxtables: Fix memleak in xtopt_parse_hostmask()
3a00e5
3a00e5
The allocated hostmask duplicate needs to be freed again.
3a00e5
3a00e5
Fixes: 66266abd17adc ("libxtables: XTTYPE_HOSTMASK support")
3a00e5
Signed-off-by: Phil Sutter <phil@nwl.cc>
3a00e5
(cherry picked from commit ffe88f8f01263687e82ef4d3d2bdc0cb5444711e)
3a00e5
---
3a00e5
 libxtables/xtoptions.c | 1 +
3a00e5
 1 file changed, 1 insertion(+)
3a00e5
3a00e5
diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c
3a00e5
index d329f2ff7979e..0dcdf607f4678 100644
3a00e5
--- a/libxtables/xtoptions.c
3a00e5
+++ b/libxtables/xtoptions.c
3a00e5
@@ -763,6 +763,7 @@ static void xtopt_parse_hostmask(struct xt_option_call *cb)
3a00e5
 	cb->arg = p;
3a00e5
 	xtopt_parse_plenmask(cb);
3a00e5
 	cb->arg = orig_arg;
3a00e5
+	free(work);
3a00e5
 }
3a00e5
 
3a00e5
 static void xtopt_parse_ethermac(struct xt_option_call *cb)
3a00e5
-- 
3a00e5
2.31.1
3a00e5