[Lldb-commits] [PATCH] D100800: [lldb] Fix demangler leaks in the DWARF AST parser

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 19 15:54:04 PDT 2021


teemperor added a comment.

Thanks for fixing this, I guess we really need a leak sanitizer/valgrind bot for LLDB...

I just have some minor comments but otherwise this LGTM.



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:1229
       if (!function_decl) {
+        char *buf = nullptr;
         llvm::StringRef name = attrs.name.GetStringRef();
----------------
`name_buf` ? From what I can see this could also be a unique_ptr with a custom deleter so that using `name` is always safe?


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:1249
             attrs.is_inline);
+        free(buf);
 
----------------
`std::free` ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100800/new/

https://reviews.llvm.org/D100800



More information about the lldb-commits mailing list