Check return value from pclose.
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 20 Jun 2009 13:55:49 +0000 (14:55 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 20 Jun 2009 13:55:49 +0000 (14:55 +0100)
daemon/find.c

index a873bca..287aae3 100644 (file)
@@ -113,7 +113,11 @@ do_find (char *dir)
       return NULL;
     }
   }
-  pclose (fp);
+  if (pclose (fp) == -1) {
+    reply_with_perror ("pclose: find");
+    free_stringslen (res, size);
+    return NULL;
+  }
 
   if (r == -1) {
     free_stringslen (res, size);