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:
parent
219600c94e
commit
72851bb9ef
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user