[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RESEND] elf2dmp: free memory in failure

From: Laurent Vivier
Subject: Re: [PATCH RESEND] elf2dmp: free memory in failure
Date: Sat, 22 Oct 2022 23:11:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1

Le 07/10/2022 à 04:01, luzhipeng a écrit :
From: lu zhipeng <luzhipeng@cestc.cn>

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>
  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;

Applied to my trivial-patches branch.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]