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>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 14 Nov 2023 16:13:07 +0800
From: heminhong <heminhong@...inos.cn>
To: stephen@...workplumber.org,
	netdev@...r.kernel.org
Cc: heminhong <heminhong@...inos.cn>
Subject: [PATCH] iproute2: prevent memory leak on error return

When rtnl_statsdump_req_filter() or rtnl_dump_filter() failed to process,
just return will cause memory leak.

Signed-off-by: heminhong <heminhong@...inos.cn>
---
 ip/iplink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ip/iplink.c b/ip/iplink.c
index 9a548dd3..c7e5021c 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -1722,11 +1722,13 @@ static int iplink_afstats(int argc, char **argv)
 	if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask,
 				      NULL, NULL) < 0) {
 		perror("Cannont send dump request");
+		delete_json_obj();
 		return 1;
 	}
 
 	if (rtnl_dump_filter(&rth, print_af_stats, &ctx) < 0) {
 		fprintf(stderr, "Dump terminated\n");
+		delete_json_obj();
 		return 1;
 	}
 
-- 
2.25.1


Powered by blists - more mailing lists