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: <20221130023635.2665668-1-konstantin.meskhidze@huawei.com>
Date:   Wed, 30 Nov 2022 10:36:35 +0800
From:   Konstantin Meskhidze <konstantin.meskhidze@...wei.com>
To:     <jpoimboe@...nel.org>
CC:     <peterz@...radead.org>, <nathan@...nel.org>,
        <ndesaulniers@...gle.com>, <trix@...hat.com>,
        <linux-kernel@...r.kernel.org>, <llvm@...ts.linux.dev>,
        <yusongping@...wei.com>, <hukeping@...wei.com>,
        <artem.kuzin@...wei.com>
Subject: [PATCH] objtool: Fix memory leakage

This commit fixes memory leakage in handle_group_alt() function.

Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@...wei.com>
---
 tools/objtool/check.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 43ec14c29a60..2689098e9bad 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1569,6 +1569,7 @@ static int handle_group_alt(struct objtool_file *file,
 				     sizeof(struct cfi_state *));
 	if (!orig_alt_group->cfi) {
 		WARN("calloc failed");
+		free(orig_alt_group);
 		return -1;
 	}
 
@@ -1603,6 +1604,7 @@ static int handle_group_alt(struct objtool_file *file,
 		nop = malloc(sizeof(*nop));
 		if (!nop) {
 			WARN("malloc failed");
+			free(new_alt_group);
 			return -1;
 		}
 		memset(nop, 0, sizeof(*nop));
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ