9 Star 0 Fork 17

src-openEuler / libnl3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fix-leak-in-error-handling-of-rtnl_flower_append_action.patch 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
sun_hai 提交于 2024-04-25 21:26 . sync some pathes from upstream
From 7912b4f90668afab9b7cb7054434d341826b8c54 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Fri, 1 Dec 2023 19:51:41 +0100
Subject: [PATCH] route/cls: fix leak in error handling of
rtnl_flower_append_action()
Using rtnl_act_append() correctly is hard.
Fixes: ef46de143206 ('route/cls: add flower classifier')
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/7912b4f90668afab9b7cb7054434d341826b8c54
---
lib/route/cls/flower.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/route/cls/flower.c b/lib/route/cls/flower.c
index 11bd709..65f0ccf 100644
--- a/lib/route/cls/flower.c
+++ b/lib/route/cls/flower.c
@@ -787,6 +787,7 @@ int rtnl_flower_get_ipv4_dst(struct rtnl_cls *cls, in_addr_t *out_addr,
int rtnl_flower_append_action(struct rtnl_cls *cls, struct rtnl_act *act)
{
struct rtnl_flower *f;
+ int err;
if (!act)
return 0;
@@ -796,8 +797,11 @@ int rtnl_flower_append_action(struct rtnl_cls *cls, struct rtnl_act *act)
f->cf_mask |= FLOWER_ATTR_ACTION;
+ if ((err = rtnl_act_append(&f->cf_act, act)) < 0)
+ return err;
+
rtnl_act_get(act);
- return rtnl_act_append(&f->cf_act, act);
+ return 0;
}
/**
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libnl3.git
git@gitee.com:src-openeuler/libnl3.git
src-openeuler
libnl3
libnl3
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891