[libvirt] [PATCHv2 8/9] phyp: avoid memory leaks in command values
Eric Blake
eblake at redhat.com
Fri Apr 15 21:33:49 UTC 2011
On 04/15/2011 02:56 PM, Matthias Bolte wrote:
> 2011/4/14 Eric Blake <eblake at redhat.com>:
>> * src/phyp/phyp_driver.c (phypExecBuffer): New function. Use it
>> throughout file for less code, and for plugging a few leaks.
>> ---
>>
>> Amazing how much copy-and-paste code this consolidated.
>>
>> " -p %s -o a -s %d -d 0 -a \"adapter_type=server\"",
>> vios_name, slot);
>> - if (virBufferError(&buf)) {
>> - virBufferFreeAndReset(&buf);
>> - virReportOOMError();
>> - goto cleanup;
>> - }
>> -
>> - VIR_FREE(cmd);
>> - VIR_FREE(ret);
>
> Why are you killing the VIR_FREE(ret) here, in the hunk before you
> left it in. It's necessary here too.
Accident of rebasing. I had previously inserted VIR_FREE(ret) earlier
in the function, before your patch to independently fix leaks of ret,
and missed that my rebase was deleting your instances.
>
> ACK, with that VIR_FREEs left in.
I've added those back in, and pushed 1-8.
--
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/20110415/71c3a775/attachment-0001.sig>
More information about the libvir-list
mailing list