Atsushi Kumagai
2017-05-26 01:48:13 UTC
commit f10d1e2e94c50 introduced another bug while fixing memory leak.
Use the braces with if condition.
Thanks, I'll merge this into v1.6.2Use the braces with if condition.
Atsushi Kumagai
---
elf_info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/elf_info.c b/elf_info.c
index 601d66e3f176..69b1719b020f 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -893,9 +893,10 @@ int get_kcore_dump_loads(void)
if (p->phys_start == NOT_PADDR
|| !is_phys_addr(p->virt_start))
continue;
- if (j >= loads)
+ if (j >= loads) {
free(pls);
return FALSE;
+ }
if (j == 0) {
offset_pt_load_memory = p->file_offset;
--
2.9.3
elf_info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/elf_info.c b/elf_info.c
index 601d66e3f176..69b1719b020f 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -893,9 +893,10 @@ int get_kcore_dump_loads(void)
if (p->phys_start == NOT_PADDR
|| !is_phys_addr(p->virt_start))
continue;
- if (j >= loads)
+ if (j >= loads) {
free(pls);
return FALSE;
+ }
if (j == 0) {
offset_pt_load_memory = p->file_offset;
--
2.9.3