[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220218032219.97114-1-liaohua4@huawei.com>
Date: Fri, 18 Feb 2022 11:22:19 +0800
From: Liao Hua <liaohua4@...wei.com>
To: <david.oberhollenzer@...ma-star.at>, <richard@....at>,
<yangds.fnst@...fujitsu.com>, <david@...ma-star.at>,
<daniel.wagner@...mens.com>
CC: <linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<wangfangpeng1@...wei.com>, <liaohua4@...wei.com>
Subject: [PATCH mtd-utils] nor-utils: fix memory leak
From: liaohua <liaohua4@...wei.com>
This patch replace "free(rfd.sector_map)" with "free(rfd.header)"
to fix memory leak.
Signed-off-by: liaohua <liaohua4@...wei.com>
---
nor-utils/rfddump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nor-utils/rfddump.c b/nor-utils/rfddump.c
index 01ab4c2..78ec443 100644
--- a/nor-utils/rfddump.c
+++ b/nor-utils/rfddump.c
@@ -256,7 +256,7 @@ int main(int argc, char *argv[])
if (!rfd.sector_map) {
perror(PROGRAM_NAME);
close(fd);
- free(rfd.sector_map);
+ free(rfd.header);
return 2;
}
--
2.12.3
Powered by blists - more mailing lists