elf2dmp: free memory in failure
PATCH 1/1 elf2dmp: free memory in failure
From: lu zhipeng <[email protected]>
Signed-off-by lu zhipeng <[email protected]>
--- contrib/elf2dmp/main.c | 1 + 1 file changed, 1 insertion(+)
contrib/elf2dmp/main.c +1 -0
@@ -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 ; }
Signature · 1 line
2.31.1
Quoted 12 lines · luzhipeng
From: lu zhipeng <[email protected]>
Signed-off-by lu zhipeng <[email protected]>--- contrib/elf2dmp/main.c | 1 + 1 file changed, 1 insertion(+)contrib/elf2dmp/main.c +0
-0
contrib/elf2dmp/main.c static KDDEBUGGER_DATA64 *get_kdbg(uint64_t KernBase, struct pdb_reader *pdb, · line 131
Quoted 7 lines
contrib/elf2dmp/main.c +1
-0@@ -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é <[email protected]>