1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

virFDStream: close also given errfd (fd leak)

In virFDStreamOpenFileInternal(), a errfd pipe is opened by
virCommandRunAsync() and given to virFDStreamOpenInternal().

It seems virFDStream should close errfd, just like the other
fd it is given.

This fixes screenshots leaking FDs:
http://bugzilla.redhat.com/show_bug.cgi?id=745761
This commit is contained in:
Marc-André Lureau 2011-10-13 13:47:58 +02:00 committed by Eric Blake
parent 219600c94e
commit 72851bb9ef

View File

@ -268,6 +268,10 @@ virFDStreamClose(virStreamPtr st)
virCommandFree(fdst->cmd);
fdst->cmd = NULL;
}
if (VIR_CLOSE(fdst->errfd) < 0)
VIR_DEBUG("ignoring failed close on fd %d", fdst->errfd);
st->privateData = NULL;
if (fdst->dispatching) {