MaskRay marked an inline comment as done.
MaskRay added inline comments.
================
Comment at: lldb/tools/driver/Driver.cpp:856
if (const char *reproducer_path = SBReproducer::GetPath()) {
- // Leaking the string on purpose.
- std::string *finalize_cmd = new std::string(argv0);
+ static std::string *finalize_cmd = new std::string(argv0);
finalize_cmd->append(" --reproducer-finalize '");
----------------
dblaikie wrote:
> Can this code execute more than once? If it does I guess it'll really leak?
>
> (if it's not meant to be called more than once, maybe something like:
> ```
> static std::string *x = nullptr;
> assert(!x);
> x = new std::string(argv0);
> ...
> ```
The function is only executed once.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100806/new/
https://reviews.llvm.org/D100806
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits