X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libdwfl%2Fdwfl_module.c;h=8efcfaa594b1dc090d2bcb5ead2e417cf6ecfee5;hb=a286dd013ef8d46edf013efc0908822a59d8ac81;hp=e703d27ed9d825171c3331db8ed0edb028ea8882;hpb=18a667176dd196f7bc3a9cdf1cbd87d4c7b31c7f;p=platform%2Fupstream%2Felfutils.git diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c index e703d27..8efcfaa 100644 --- a/libdwfl/dwfl_module.c +++ b/libdwfl/dwfl_module.c @@ -1,5 +1,5 @@ /* Maintenance of module list in libdwfl. - Copyright (C) 2005, 2006, 2007, 2008 Red Hat, Inc. + Copyright (C) 2005, 2006, 2007, 2008, 2014 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -71,7 +71,17 @@ __libdwfl_module_free (Dwfl_Module *mod) } if (mod->dw != NULL) - INTUSE(dwarf_end) (mod->dw); + { + INTUSE(dwarf_end) (mod->dw); + if (mod->alt != NULL) + { + INTUSE(dwarf_end) (mod->alt); + if (mod->alt_elf != NULL) + elf_end (mod->alt_elf); + if (mod->alt_fd != -1) + close (mod->alt_fd); + } + } if (mod->ebl != NULL) ebl_closebackend (mod->ebl); @@ -79,10 +89,17 @@ __libdwfl_module_free (Dwfl_Module *mod) if (mod->debug.elf != mod->main.elf) free_file (&mod->debug); free_file (&mod->main); + free_file (&mod->aux_sym); if (mod->build_id_bits != NULL) free (mod->build_id_bits); + if (mod->reloc_info != NULL) + free (mod->reloc_info); + + if (mod->eh_cfi != NULL) + dwarf_cfi_end (mod->eh_cfi); + free (mod->name); free (mod); }