* src/remote_internal.c: remove file descriptors leak

daniel
This commit is contained in:
Daniel Veillard 2009-03-17 11:00:56 +00:00
parent b68a19be0f
commit df59fdce06
2 changed files with 15 additions and 1 deletions

View File

@ -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> 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. * src/libvirt.c: Don't allow readonly connections to dump secure xml.

View File

@ -332,7 +332,7 @@ doRemoteOpen (virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags) int flags)
{ {
int wakeupFD[2]; int wakeupFD[2] = { -1, -1 };
char *transport_str = NULL; char *transport_str = NULL;
if (conn->uri) { if (conn->uri) {
@ -885,6 +885,11 @@ doRemoteOpen (virConnectPtr conn,
#endif #endif
} }
if (wakeupFD[0] >= 0) {
close(wakeupFD[0]);
close(wakeupFD[1]);
}
VIR_FREE(priv->hostname); VIR_FREE(priv->hostname);
goto cleanup; goto cleanup;
} }
@ -1350,6 +1355,11 @@ doRemoteClose (virConnectPtr conn, struct private_data *priv)
} while (reap != -1 && reap != priv->pid); } while (reap != -1 && reap != priv->pid);
} }
#endif #endif
if (priv->wakeupReadFD >= 0) {
close(priv->wakeupReadFD);
close(priv->wakeupSendFD);
}
/* Free hostname copy */ /* Free hostname copy */
free (priv->hostname); free (priv->hostname);