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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241121133212.6809-1-liujing@cmss.chinamobile.com>
Date: Thu, 21 Nov 2024 21:32:12 +0800
From: liujing <liujing@...s.chinamobile.com>
To: trenn@...e.com,
	shuah@...nel.org,
	jwyatt@...hat.com,
	jkacur@...hat.com
Cc: linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	liujing <liujing@...s.chinamobile.com>
Subject: [PATCH] cpupower: Fixing memory leaks

If execlp fails, page memory is not freed, so fix it.

Signed-off-by: liujing <liujing@...s.chinamobile.com>

diff --git a/tools/power/cpupower/utils/cpupower.c b/tools/power/cpupower/utils/cpupower.c
index 9ec973165af1..36d486199630 100644
--- a/tools/power/cpupower/utils/cpupower.c
+++ b/tools/power/cpupower/utils/cpupower.c
@@ -98,7 +98,7 @@ static int print_man_page(const char *subpage)
 	}
 
 	execlp("man", "man", page, NULL);
-
+	free(page);
 	/* should not be reached */
 	return -EINVAL;
 }
-- 
2.27.0




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ