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)
if (fd == -1)
return;
- if (fstat (fd, &sbuf) == -1)
+ if (fstat (fd, &sbuf) == -1) {
+ close (fd);
return;
+ }
buf = calloc (sbuf.st_size + 1, sizeof(char));
read (fd, buf, sbuf.st_size);