mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +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[1]);
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
VIR_FORCE_CLOSE(errfd);
|
||||
if (oflags & O_CREAT)
|
||||
unlink(path);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user