iproute/backport-ctrl-Fix-fd-leak-in-ctrl_list.patch

32 lines
957 B
Diff
Raw Normal View History

2024-07-26 02:49:31 +00:00
From 35c02157396c847e57f52b5d6d345af2b961a794 Mon Sep 17 00:00:00 2001
From: Maks Mishin <maks.mishinfz@gmail.com>
Date: Wed, 7 Feb 2024 02:54:03 +0300
Subject: [PATCH] ctrl: Fix fd leak in ctrl_list()
if ctrl_list is called with get operation and wrong number
of parameters, it would forget to close the local netlink
handle.
Conflict:no
Reference:https://github.com/iproute2/iproute2/commit/35c02157396c847e57f52b5d6d345af2b961a794
Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
genl/ctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/genl/ctrl.c b/genl/ctrl.c
index aff922a43..bae73a54b 100644
--- a/genl/ctrl.c
+++ b/genl/ctrl.c
@@ -267,7 +267,7 @@ static int ctrl_list(int cmd, int argc, char **argv)
if (argc != 2) {
fprintf(stderr, "Wrong number of params\n");
- return -1;
+ goto ctrl_done;
}
if (matches(*argv, "name") == 0) {