Blame SOURCES/0011-netlink-Avoid-memleak-in-error-path-of-netlink_delin.patch

168a1c
From 3ec01f287b0b61c0e6d885a7e96dcfa5afa800b8 Mon Sep 17 00:00:00 2001
168a1c
From: Phil Sutter <phil@nwl.cc>
168a1c
Date: Fri, 11 Jun 2021 16:46:48 +0200
168a1c
Subject: [PATCH] netlink: Avoid memleak in error path of
168a1c
 netlink_delinearize_obj()
168a1c
168a1c
If parsing udata fails, 'obj' has to be freed before returning to
168a1c
caller.
168a1c
168a1c
Fixes: 293c9b114faef ("src: add comment support for objects")
168a1c
Signed-off-by: Phil Sutter <phil@nwl.cc>
168a1c
(cherry picked from commit 97b5d4bbcac4d3237f114c1c6a57c37968ebe0fc)
168a1c
Signed-off-by: Phil Sutter <psutter@redhat.com>
168a1c
---
168a1c
 src/netlink.c | 1 +
168a1c
 1 file changed, 1 insertion(+)
168a1c
168a1c
diff --git a/src/netlink.c b/src/netlink.c
168a1c
index fd82b16cb9f6e..4c03baeff5d66 100644
168a1c
--- a/src/netlink.c
168a1c
+++ b/src/netlink.c
168a1c
@@ -1445,6 +1445,7 @@ struct obj *netlink_delinearize_obj(struct netlink_ctx *ctx,
168a1c
 		udata = nftnl_obj_get_data(nlo, NFTNL_OBJ_USERDATA, &ulen);
168a1c
 		if (nftnl_udata_parse(udata, ulen, obj_parse_udata_cb, ud) < 0) {
168a1c
 			netlink_io_error(ctx, NULL, "Cannot parse userdata");
168a1c
+			obj_free(obj);
168a1c
 			return NULL;
168a1c
 		}
168a1c
 		if (ud[NFTNL_UDATA_OBJ_COMMENT])
168a1c
-- 
168a1c
2.31.1
168a1c