Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] elf_info.c: fix memory leak in get_kcore_dump_loads()
@ 2017-03-21  3:28 Pingfan Liu
  2017-03-22  6:59 ` Atsushi Kumagai
  0 siblings, 1 reply; 3+ messages in thread
From: Pingfan Liu @ 2017-03-21  3:28 UTC (permalink / raw)
  To: kexec

Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
 elf_info.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elf_info.c b/elf_info.c
index d84553a..35e754b 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -893,12 +893,14 @@ int get_kcore_dump_loads(void)
 				|| !is_phys_addr(p->virt_start))
 			continue;
 		if (j >= loads)
+			free(pls)
 			return FALSE;
 
 		if (j == 0) {
 			offset_pt_load_memory = p->file_offset;
 			if (offset_pt_load_memory == 0) {
 				ERRMSG("Can't get the offset of page data.\n");
+				free(pls)
 				return FALSE;
 			}
 		}
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-22  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-21  3:28 [PATCH] elf_info.c: fix memory leak in get_kcore_dump_loads() Pingfan Liu
2017-03-22  6:59 ` Atsushi Kumagai
2017-03-22  7:18   ` Pingfan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox