lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240206235416.18086-1-maks.mishinFZ@gmail.com>
Date: Wed,  7 Feb 2024 02:54:16 +0300
From: Maks Mishin <maks.mishinfz@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Maks Mishin <maks.mishinFZ@...il.com>,
	netdev@...r.kernel.org
Subject: [PATCH] ctrl: Fix fd leak in ctrl_listen()

Signed-off-by: Maks Mishin <maks.mishinFZ@...il.com>
---
 genl/ctrl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/genl/ctrl.c b/genl/ctrl.c
index aff922a4..783c3591 100644
--- a/genl/ctrl.c
+++ b/genl/ctrl.c
@@ -333,8 +333,10 @@ static int ctrl_listen(int argc, char **argv)
 		return -1;
 	}
 
-	if (rtnl_listen(&rth, print_ctrl, (void *) stdout) < 0)
+	if (rtnl_listen(&rth, print_ctrl, (void *) stdout) < 0) {
+		rtnl_close(&rth);
 		return -1;
+	}
 
 	return 0;
 }
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ