mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
libvirtd.c: avoid closing a negative socket file descriptor
* daemon/libvirtd.c (qemudListenUnix): Close socket only if non-negative.
This commit is contained in:
parent
3db3acb94e
commit
c37ff6a1ec
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* libvirtd.c: daemon start of day, guest process & i/o management
|
* libvirtd.c: daemon start of day, guest process & i/o management
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
|
* Copyright (C) 2006-2010 Red Hat, Inc.
|
||||||
* Copyright (C) 2006 Daniel P. Berrange
|
* Copyright (C) 2006 Daniel P. Berrange
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
@ -582,7 +582,7 @@ static int qemudListenUnix(struct qemud_server *server,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (sock->fd)
|
if (sock->fd >= 0)
|
||||||
close(sock->fd);
|
close(sock->fd);
|
||||||
VIR_FREE(sock);
|
VIR_FREE(sock);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user