summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Hunt <james.hunt@ubuntu.com>2011-10-11 22:03:08 -0400
committerRay Strode <rstrode@redhat.com>2011-10-11 22:03:08 -0400
commitbcb27226b7e2e1d2819ba672f90e3a1e8e7c459d (patch)
tree0546639c63c974c245f858b7aa3db0d2bde81230
parent9fffcda4c55a352c58d1c630d508ac0544ae1498 (diff)
text-progress-bar: plug fd leak
This plugs a fd leak in an error path
-rw-r--r--src/libply-splash-core/ply-text-progress-bar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libply-splash-core/ply-text-progress-bar.c b/src/libply-splash-core/ply-text-progress-bar.c
index 7ac02220..faf84a4d 100644
--- a/src/libply-splash-core/ply-text-progress-bar.c
+++ b/src/libply-splash-core/ply-text-progress-bar.c
@@ -106,8 +106,10 @@ get_os_string (void)
106 if (fd == -1) 106 if (fd == -1)
107 return; 107 return;
108 108
109 if (fstat (fd, &sbuf) == -1) 109 if (fstat (fd, &sbuf) == -1) {
110 close (fd);
110 return; 111 return;
112 }
111 113
112 buf = calloc (sbuf.st_size + 1, sizeof(char)); 114 buf = calloc (sbuf.st_size + 1, sizeof(char));
113 read (fd, buf, sbuf.st_size); 115 read (fd, buf, sbuf.st_size);