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

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



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 virtuozzo com>
> ---
>  src/rpc/virnetclient.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange redhat com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


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