Re: [PATCH] virNetlinkDumpCommand: Don't leak response buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/19/2018 10:13 AM, Erik Skultety wrote:
> On Mon, Mar 19, 2018 at 07:47:08AM +0100, Michal Privoznik wrote:
>> ==16451== 32,768 bytes in 2 blocks are definitely lost in loss record 1,007 of 1,013
>> ==16451==    at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)
>> ==16451==    by 0x7CADB40: nl_recv (in /usr/lib64/libnl-3.so.200.23.0)
>> ==16451==    by 0x532DFAC: virNetlinkDumpCommand (virnetlink.c:363)
>> ==16451==    by 0x53236AE: virNetDevIPCheckIPv6Forwarding (virnetdevip.c:641)
>> ==16451==    by 0xE3E4A1A: networkStartNetworkVirtual (bridge_driver.c:2490)
>> ==16451==    by 0xE3E55F5: networkStartNetwork (bridge_driver.c:2832)
>> ==16451==    by 0xE3DFFE5: networkAutostartConfig (bridge_driver.c:531)
>> ==16451==    by 0x53F47E0: virNetworkObjListForEachHelper (virnetworkobj.c:1412)
>> ==16451==    by 0x52FE69F: virHashForEach (virhash.c:606)
>> ==16451==    by 0x53F4857: virNetworkObjListForEach (virnetworkobj.c:1439)
>> ==16451==    by 0xE3E0BF4: networkStateAutoStart (bridge_driver.c:808)
>> ==16451==    by 0x55689CE: virStateInitialize (libvirt.c:758)
>>
>> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
>> ---
>>  src/util/virnetlink.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
>> index 0e281b06b8..955f1558ee 100644
>> --- a/src/util/virnetlink.c
>> +++ b/src/util/virnetlink.c
>> @@ -360,6 +360,7 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg,
>>          goto cleanup;
>>
>>      while (!end) {
>> +        VIR_FREE(resp);
> 
> Personally, I'd put this at the end of the loop rather than at the beginning
> but that's a matter of taste, function-wise it doesn't matter, so

Okay, I've moved it at the end of the loop body and pushed. Thanks.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux