[libvirt] [PATCH] Fix a memory leak in the qemudBuildCommandLine.

Eric Blake eblake at redhat.com
Fri Jul 30 14:06:33 UTC 2010


On 07/30/2010 08:02 AM, Chris Lalancette wrote:
> On 07/30/10 - 08:02:08AM, Eric Blake wrote:
>> On 07/30/2010 07:47 AM, Chris Lalancette wrote:
>>> ADD_ARG_LIT should only be used for literal arguments,
>>> since it duplicates the memory.  Since virBufferContentAndReset
>>> is already allocating memory, we should only use ADD_ARG.
>>
>> ACK.
>>
>> Hmm, wondering if there is a way to make use of gcc's
>> __builtin_constant_p() to enforce that ADD_ARG_LIT is passed a string
>> constant.
> 
> Interesting idea.  I know danpb wanted to remove all of the macros used in
> qemudBuildCommandLine, though, so you may want to consult with him before
> spending too much time on it.

True - his pending exec library rewrite will override anything we do to
the macros.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100730/9abf7c5d/attachment-0001.sig>


More information about the libvir-list mailing list