Re: [PATCH 2/2] nwfilter: Only free inetaddr on virNWFilterIPAddrMapAddIPAddr failure

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

 



[...]

> 
> This assumes that virNWFilterIPAddrMapAddIPAddr consumes inetaddr only
> if it returns zero. However in a fraction of the unlikely cases when
> this function call can fail (all of them on OOM), it can consume it even
> though it returns -1 -- if virNWFilterVarValueCreateSimple succeeds,
> but virNWFilterHashTablePut fails.
> 

If virNWFilterHashTablePut fails in virNWFilterIPAddrMapAddIPAddr, then
it calls virNWFilterVarValueFree which will VIR_FREE the value that was
stored in @val which is returned from virNWFilterVarValueCreateSimple.

I still hate the nwfilter code.

John

>>             }
>>
>>             ret = virNWFilterInstantiateFilterLate(req->driver,
>> @@ -637,7 +639,8 @@ learnIPAddressThread(void *arg)
>>                                                    req->filterparams);
>>             VIR_DEBUG("Result from applying firewall rules on "
>>                       "%s with IP addr %s : %d", req->ifname,
>> inetaddr, ret);

[...]

--
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