From aa7d50ce823120812823d98da1fffa845830c456 Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Wed, 30 May 2012 17:20:46 +0800 Subject: [PATCH] avoid fd leak virCommandRunAsync() will set errfd if it succeed. We should close it if virFDStreamOpenInternal() fails. (cherry picked from commit 655cffa0f25be40c68624036af80bde102177612) --- src/fdstream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fdstream.c b/src/fdstream.c index 32d386dce6..fca0f412d6 100644 --- a/src/fdstream.c +++ b/src/fdstream.c @@ -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;