[PATCH] dbghelp: Fix possible memory leak (Coverity)

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Wed Dec 8 14:33:57 CST 2021


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/dbghelp/dwarf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index 67440e97fe8..7515e540778 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -2314,7 +2314,10 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_debug_info_t* di)
      * Actual thunks will be created in elf_module from the symbol table
      */
     if (elf_is_in_thunk_area(di->unit_ctx->module_ctx->load_offset + addr_ranges[0].low, di->unit_ctx->module_ctx->thunks) >= 0)
+    {
+        free(addr_ranges);
         return NULL;
+    }
     ret_type = dwarf2_lookup_type(di);
 
     /* FIXME: assuming C source code */
-- 
2.33.0




More information about the wine-devel mailing list