Re: [PATCH] rpc: virNetClientNew: fix socket leak on error path

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

 




On 18.01.2019 13:32, Daniel P. Berrangé wrote:
> On Fri, Jan 18, 2019 at 11:38:39AM +0300, Nikolay Shirokovskiy wrote:
>> if virNetClientNew finishes with error before sock is set
>> to client object then sock does not get unrefed. This is
>> unexpected by function clients like virNetClientNewUNIX.
>> Let's make sure sock gets unrefed on any error path.
>>
>> Next some clients like virNetClientNewLibSSH2 try to unref
>> sock on virNetClientNew errors. This is not correct even
>> before this patch because in some cases virNetClientNew
>> unrefed sock on error path by itself. Let's give up
>> sock managment to virNetClientNew entirely.
>>
>> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
>> ---
>>  src/rpc/virnetclient.c | 8 +++-----
>>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
> 

Thanks! Pushed.

Nikolay

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