<div dir="ltr">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?</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 25, 2017 at 2:04 PM Francis Ricci <<a href="mailto:francisjricci@gmail.com">francisjricci@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm probably not the best resource on the xar apis, I was just fixing<br>
the memory leaks I found with LSan. However, I did look at the API and<br>
don't see anything that suggests RAII, and I don't see any other open<br>
source code not using manual frees.<br>
<br>
On Mon, Sep 25, 2017 at 4:52 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
> Ping<br>
><br>
> On Mon, Sep 18, 2017 at 11:30 AM David Blaikie via Phabricator via<br>
> llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> dblaikie added inline comments.<br>
>><br>
>><br>
>> ================<br>
>> Comment at: llvm/trunk/tools/llvm-objdump/MachODump.cpp:5884<br>
>>      outs() << "\n";<br>
>> +    xar_iter_free(xp);<br>
>>    }<br>
>> ----------------<br>
>> Any chance of an RAII API for this resource, to avoid the accident-prone<br>
>> manual cleanup/free?<br>
>><br>
>><br>
>> Repository:<br>
>>   rL LLVM<br>
>><br>
>> <a href="https://reviews.llvm.org/D37750" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37750</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>