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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 15:12:13 PDT 2017


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170925/e8f7ec0b/attachment.html>


More information about the llvm-commits mailing list