mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
* src/remote_internal.c: remove file descriptors leak
daniel
This commit is contained in:
parent
b68a19be0f
commit
df59fdce06
@ -1,3 +1,7 @@
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user