提交 c37ff6a1 编写于 作者: J Jim Meyering

libvirtd.c: avoid closing a negative socket file descriptor

* daemon/libvirtd.c (qemudListenUnix): Close socket only if non-negative.
上级 3db3acb9
/* /*
* 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, ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册