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:
Wen Congyang 2012-05-30 17:20:46 +08:00 committed by Cole Robinson
parent ab73fe59be
commit aa7d50ce82

View File

@ -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;