[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200629012149.29839-1-gaurav1086@gmail.com>
Date: Sun, 28 Jun 2020 21:21:33 -0400
From: Gaurav Singh <gaurav1086@...il.com>
To: gaurav1086@...il.com, linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] [scripts] read_file: fix memory leak
Free buf before returning to avoid memory leak.
Signed-off-by: Gaurav Singh <gaurav1086@...il.com>
---
scripts/insert-sys-cert.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/insert-sys-cert.c b/scripts/insert-sys-cert.c
index 8902836c2342..22d99a8faca9 100644
--- a/scripts/insert-sys-cert.c
+++ b/scripts/insert-sys-cert.c
@@ -250,6 +250,7 @@ static char *read_file(char *file_name, int *size)
}
if (read(fd, buf, *size) != *size) {
perror("File read failed");
+ free(buf);
close(fd);
return NULL;
}
--
2.17.1
Powered by blists - more mailing lists