summaryrefslogtreecommitdiff
path: root/kexec/arch/mips/crashdump-mips.c
diff options
context:
space:
mode:
authorYouling Tang <tangyouling@loongson.cn>2020-09-12 09:39:49 +0800
committerSimon Horman <horms@verge.net.au>2020-09-29 18:14:33 +0200
commit9fd2189baf7adc85f8017145e789d3256f6fcd24 (patch)
tree0a14b91de8eccb86bfa509512be40c5a7b869ee3 /kexec/arch/mips/crashdump-mips.c
parentec537918a32564789dad14e32389afb2991d7f8d (diff)
kexec-tools: Add some missing free() calls
Add some missing free() calls. Signed-off-by: Youling Tang <tangyouling@loongson.cn> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/mips/crashdump-mips.c')
-rw-r--r--kexec/arch/mips/crashdump-mips.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
index 26d5043..a135386 100644
--- a/kexec/arch/mips/crashdump-mips.c
+++ b/kexec/arch/mips/crashdump-mips.c
@@ -360,8 +360,11 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
crash_reserved_mem.end, -1);
if (crash_create(info, elf_info, crash_memory_range, nr_ranges,
- &tmp, &sz, ELF_CORE_HEADER_ALIGN) < 0)
+ &tmp, &sz, ELF_CORE_HEADER_ALIGN) < 0) {
+ free(tmp);
return -1;
+ }
+
elfcorehdr = add_buffer(info, tmp, sz, sz, align,
crash_reserved_mem.start,
crash_reserved_mem.end, -1);