Blame SOURCES/0010-netlink-Avoid-memleak-in-error-path-of-netlink_delin.patch
|
|
195495 |
From c47e6d3b1ccb166b807d19fd585d6b5b3cd0b7f7 Mon Sep 17 00:00:00 2001
|
|
|
195495 |
From: Phil Sutter <phil@nwl.cc>
|
|
|
195495 |
Date: Fri, 11 Jun 2021 18:33:44 +0200
|
|
|
195495 |
Subject: [PATCH] netlink: Avoid memleak in error path of
|
|
|
195495 |
netlink_delinearize_table()
|
|
|
195495 |
|
|
|
195495 |
If parsing udata fails, 'table' has to be freed before returning to
|
|
|
195495 |
caller.
|
|
|
195495 |
|
|
|
195495 |
Fixes: c156232a530b3 ("src: add comment support when adding tables")
|
|
|
195495 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
195495 |
(cherry picked from commit 47640634cff9932784a1a96836d6c5809cc8264d)
|
|
|
195495 |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
195495 |
---
|
|
|
195495 |
src/netlink.c | 1 +
|
|
|
195495 |
1 file changed, 1 insertion(+)
|
|
|
195495 |
|
|
|
195495 |
diff --git a/src/netlink.c b/src/netlink.c
|
|
|
195495 |
index 22140afc3fd7e..fd82b16cb9f6e 100644
|
|
|
195495 |
--- a/src/netlink.c
|
|
|
195495 |
+++ b/src/netlink.c
|
|
|
195495 |
@@ -620,6 +620,7 @@ struct table *netlink_delinearize_table(struct netlink_ctx *ctx,
|
|
|
195495 |
udata = nftnl_table_get_data(nlt, NFTNL_TABLE_USERDATA, &ulen);
|
|
|
195495 |
if (nftnl_udata_parse(udata, ulen, table_parse_udata_cb, ud) < 0) {
|
|
|
195495 |
netlink_io_error(ctx, NULL, "Cannot parse userdata");
|
|
|
195495 |
+ table_free(table);
|
|
|
195495 |
return NULL;
|
|
|
195495 |
}
|
|
|
195495 |
if (ud[NFTNL_UDATA_TABLE_COMMENT])
|
|
|
195495 |
--
|
|
|
195495 |
2.31.1
|
|
|
195495 |
|