avoid fd leak

virCommandRunAsync() will set errfd if it succeed. We should
close it if virFDStreamOpenInternal() fails.
This commit is contained in:
Wen Congyang 2012-05-30 17:20:46 +08:00 committed by Eric Blake
parent 0a045f01cf
commit 655cffa0f2

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;