diff --git a/src/core/util/DwarfReader.cc b/src/core/util/DwarfReader.cc index 585fe588..0a56e4ff 100644 --- a/src/core/util/DwarfReader.cc +++ b/src/core/util/DwarfReader.cc @@ -130,8 +130,10 @@ bool DwarfReader::read_source_files(const std::string& fileName,std::list(addr) << " line source:" << normalize(lineSource) << endl; @@ -173,8 +183,10 @@ bool DwarfReader::read_source_files(const std::string& fileName,std::list Dwarf_Die die; // XXX: "if there are no sibling headers, die" | semantics unclear! if (dwarf_siblingof(dbg,0,&die,0)!=DW_DLV_OK) { + close(fd); return false; } @@ -219,6 +232,7 @@ bool DwarfReader::read_mapping(std::string fileName, std::list Dwarf_Line* lineBuffer; Dwarf_Signed lineCount; if (dwarf_srclines(die,&lineBuffer,&lineCount,0)!=DW_DLV_OK) { + close(fd); continue; //return false; } @@ -226,18 +240,22 @@ bool DwarfReader::read_mapping(std::string fileName, std::list for (int index=0;index // Shut down libdwarf if (dwarf_finish(dbg,0)!=DW_DLV_OK) { + close(fd); return false; }