加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-for-memleak-when-parsing-j-arg.patch 897 Bytes
一键复制 编辑 原始数据 按行查看 历史
yangl777 提交于 2022-10-31 07:37 . Fix for memleak when parsing -j arg
From 42cb292d6c9e8567db2e30e183b1bd31093700ad Mon Sep 17 00:00:00 2001
From: Phil Sutter <phil@nwl.cc>
Date: Fri, 25 Mar 2022 10:30:29 +0100
Subject: connntrack: Fix for memleak when parsing -j arg
Have to free the strings allocated by split_address_and_port().
Fixes: 29b390a212214 ("conntrack: Support IPv6 NAT")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Conflict:do_parse => main
Reference:https://git.netfilter.org/conntrack-tools/commit/?id=42cb292d6c9e8567db2e30e183b1bd31093700ad
---
src/conntrack.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/conntrack.c b/src/conntrack.c
index f65926b..415f551 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -2466,6 +2466,8 @@ int main(int argc, char *argv[])
nfct_set_nat_details(c, tmpl.ct, &ad,
port_str, family);
}
+ free(port_str);
+ free(nat_address);
}
break;
case 'w':
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化