[Libguestfs] [PATCH] daemon: zfile: call pclose instead of fclose

Pino Toscano ptoscano at redhat.com
Mon Aug 18 09:18:50 UTC 2014


fp was opened with popen, so close it properly.
---
 daemon/file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/daemon/file.c b/daemon/file.c
index 856ab5f..f1be51a 100644
--- a/daemon/file.c
+++ b/daemon/file.c
@@ -552,12 +552,12 @@ do_zfile (const char *method, const char *path)
 
   if (fgets (line, sizeof line, fp) == NULL) {
     reply_with_perror ("fgets");
-    fclose (fp);
+    pclose (fp);
     return NULL;
   }
 
-  if (fclose (fp) == -1) {
-    reply_with_perror ("fclose");
+  if (pclose (fp) == -1) {
+    reply_with_perror ("pclose");
     return NULL;
   }
 
-- 
1.9.3




More information about the Libguestfs mailing list