diff options
author | lu zhipeng | 2022-10-07 04:01:28 +0200 |
---|---|---|
committer | Laurent Vivier | 2022-10-22 23:10:03 +0200 |
commit | 4bb5923605b2b8994f933df23aa948efe7ba545c (patch) | |
tree | dc7729918238039e89936b809b8137ab29d3da36 /contrib | |
parent | hw/core: Tidy up unnecessary casting away of const (diff) | |
download | qemu-4bb5923605b2b8994f933df23aa948efe7ba545c.tar.gz qemu-4bb5923605b2b8994f933df23aa948efe7ba545c.tar.xz qemu-4bb5923605b2b8994f933df23aa948efe7ba545c.zip |
elf2dmp: free memory in failure
The 'kdgb' is allocating memory in get_kdbg(), but it is not freed in
error path. So fix that.
Signed-off-by: lu zhipeng <luzhipeng@cestc.cn>
Reviewed-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221007020128.760-1-luzhipeng@cestc.cn>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/elf2dmp/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index b9fc6d230c..d77b8f98f7 100644 --- a/contrib/elf2dmp/main.c +++ b/contrib/elf2dmp/main.c @@ -125,6 +125,7 @@ static KDDEBUGGER_DATA64 *get_kdbg(uint64_t KernBase, struct pdb_reader *pdb, if (va_space_rw(vs, KdDebuggerDataBlock, kdbg, kdbg_hdr.Size, 0)) { eprintf("Failed to extract entire KDBG\n"); + free(kdbg); return NULL; } |