mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
avoid fd leak
virCommandRunAsync() will set errfd if it succeed. We should close it if virFDStreamOpenInternal() fails.
This commit is contained in:
parent
0a045f01cf
commit
655cffa0f2
@ -668,6 +668,7 @@ error:
|
|||||||
VIR_FORCE_CLOSE(fds[0]);
|
VIR_FORCE_CLOSE(fds[0]);
|
||||||
VIR_FORCE_CLOSE(fds[1]);
|
VIR_FORCE_CLOSE(fds[1]);
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
|
VIR_FORCE_CLOSE(errfd);
|
||||||
if (oflags & O_CREAT)
|
if (oflags & O_CREAT)
|
||||||
unlink(path);
|
unlink(path);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user