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

src/libply/ply-logger.c

index df4738f354c2f961be1915810736c2d630a18ad5..f51bb8471db3069b9a2628ec29b5344450b53cfa 100644 (file)
@@ -338,8 +338,10 @@ ply_logger_open_file (ply_logger_t    *logger,
   if (fd < 0)
     return false;
 
-  if (fchmod (fd, mode) < 0)
+  if (fchmod (fd, mode) < 0) {
+    close (fd);
     return false;
+  }
 
   ply_logger_set_output_fd (logger, fd);