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.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Maks Mishin
2024-02-07 02:54:03 +03:00
committed by Stephen Hemminger
parent e333097527
commit 35c0215739

View File

@@ -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) {