提交 df59fdce 编写于 作者: D Daniel Veillard

* src/remote_internal.c: remove file descriptors leak

daniel
上级 b68a19be
Tue Mar 17 11:58:58 CET 2009 Daniel Veillard <veillard@redhat.com>
* src/remote_internal.c: remove file descriptors leak
Mon Mar 16 13:17:05 EDT 2009 Cole Robinson <crobinso@redhat.com>
* src/libvirt.c: Don't allow readonly connections to dump secure xml.
......
......@@ -332,7 +332,7 @@ doRemoteOpen (virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags)
{
int wakeupFD[2];
int wakeupFD[2] = { -1, -1 };
char *transport_str = NULL;
if (conn->uri) {
......@@ -885,6 +885,11 @@ doRemoteOpen (virConnectPtr conn,
#endif
}
if (wakeupFD[0] >= 0) {
close(wakeupFD[0]);
close(wakeupFD[1]);
}
VIR_FREE(priv->hostname);
goto cleanup;
}
......@@ -1350,6 +1355,11 @@ doRemoteClose (virConnectPtr conn, struct private_data *priv)
} while (reap != -1 && reap != priv->pid);
}
#endif
if (priv->wakeupReadFD >= 0) {
close(priv->wakeupReadFD);
close(priv->wakeupSendFD);
}
/* Free hostname copy */
free (priv->hostname);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册