]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
utils: plug dir fd leak
authorJames Hunt <james.hunt@ubuntu.com>
Wed, 12 Oct 2011 02:08:48 +0000 (22:08 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 12 Oct 2011 02:08:48 +0000 (22:08 -0400)
This commit calls closedir() in an error path.

src/libply/ply-utils.c

index b021f2f22d3a8851c042e8765005910493d7127b..6aa76f03fcf314951deb2e6af4e51601a9d6787b 100644 (file)
@@ -553,8 +553,10 @@ ply_close_open_fds (void)
 
       if ((*byte_after_number != '\0') ||
           (filename_as_number < 0) ||
-          (filename_as_number > INT_MAX)) 
+          (filename_as_number > INT_MAX)) {
+        closedir (dir);
         return false;
+      }
 
       fd = (int) filename_as_number;