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]
Date:	Mon, 03 Oct 2011 17:22:42 +0200
From:	Thomas Jarosch <thomas.jarosch@...ra2net.com>
To:	netdev@...r.kernel.org
Subject: [iproute2 PATCH 02/11] Fix file descriptor leak on error in rtnl_hash_initialize()

Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@...ra2net.com>
---
 lib/rt_names.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/rt_names.c b/lib/rt_names.c
index 30d43cd..a290021 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -54,6 +54,7 @@ rtnl_hash_initialize(char *file, struct rtnl_hash_entry **hash, int size)
 		    sscanf(p, "%d %s #", &id, namebuf) != 2) {
 			fprintf(stderr, "Database %s is corrupted at %s\n",
 				file, p);
+			fclose(fp);
 			return;
 		}
 
@@ -91,6 +92,7 @@ static void rtnl_tab_initialize(char *file, char **tab, int size)
 		    sscanf(p, "%d %s #", &id, namebuf) != 2) {
 			fprintf(stderr, "Database %s is corrupted at %s\n",
 				file, p);
+			fclose(fp);
 			return;
 		}
 
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ