mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 21:15:22 +00:00
avoid fd leak
virCommandRunAsync() will set errfd if it succeed. We should
close it if virFDStreamOpenInternal() fails.
(cherry picked from commit 655cffa0f2
)
This commit is contained in:
parent
ab73fe59be
commit
aa7d50ce82
@ -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…
Reference in New Issue
Block a user