* [PATCH] elf2dmp: free memory in failure
@ 2022-09-29 12:04 luzhipeng
2022-10-18 6:42 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 2+ messages in thread
From: luzhipeng @ 2022-09-29 12:04 UTC (permalink / raw)
To: qemu-devel; +Cc: Viktor Prutyanov, lu zhipeng
From: lu zhipeng <luzhipeng@cestc.cn>
Signed-off-by: lu zhipeng <luzhipeng@cestc.cn>
---
contrib/elf2dmp/main.c | 1 +
1 file changed, 1 insertion(+)
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;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] elf2dmp: free memory in failure
2022-09-29 12:04 [PATCH] elf2dmp: free memory in failure luzhipeng
@ 2022-10-18 6:42 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-10-18 6:42 UTC (permalink / raw)
To: luzhipeng, qemu-devel; +Cc: Viktor Prutyanov, QEMU Trivial
On 29/9/22 14:04, luzhipeng wrote:
> From: lu zhipeng <luzhipeng@cestc.cn>
>
> Signed-off-by: lu zhipeng <luzhipeng@cestc.cn>
> ---
> contrib/elf2dmp/main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> 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;
> }
>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-18 7:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-29 12:04 [PATCH] elf2dmp: free memory in failure luzhipeng
2022-10-18 6:42 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).