[PATCH] D37750: [llvm-objdump] Fix memory leaks in macho dump

Francis Ricci via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 14:02:53 PDT 2017


Added here - https://reviews.llvm.org/D38598

On Mon, Sep 25, 2017 at 6:12 PM, David Blaikie <dblaikie at gmail.com> wrote:
> Oh, I meant could an RAII API be introduced/written (a small/simple helper
> class to do the cleanup, etc) to help avoid these sorts of bugs?
>
> On Mon, Sep 25, 2017 at 2:04 PM Francis Ricci <francisjricci at gmail.com>
> wrote:
>>
>> I'm probably not the best resource on the xar apis, I was just fixing
>> the memory leaks I found with LSan. However, I did look at the API and
>> don't see anything that suggests RAII, and I don't see any other open
>> source code not using manual frees.
>>
>> On Mon, Sep 25, 2017 at 4:52 PM, David Blaikie <dblaikie at gmail.com> wrote:
>> > Ping
>> >
>> > On Mon, Sep 18, 2017 at 11:30 AM David Blaikie via Phabricator via
>> > llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> >>
>> >> dblaikie added inline comments.
>> >>
>> >>
>> >> ================
>> >> Comment at: llvm/trunk/tools/llvm-objdump/MachODump.cpp:5884
>> >>      outs() << "\n";
>> >> +    xar_iter_free(xp);
>> >>    }
>> >> ----------------
>> >> Any chance of an RAII API for this resource, to avoid the
>> >> accident-prone
>> >> manual cleanup/free?
>> >>
>> >>
>> >> Repository:
>> >>   rL LLVM
>> >>
>> >> https://reviews.llvm.org/D37750
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> llvm-commits mailing list
>> >> llvm-commits at lists.llvm.org
>> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list