summaryrefslogtreecommitdiff
authorJames Hunt <james.hunt@ubuntu.com>2011-10-12 02:03:08 (GMT)
committer Ray Strode <rstrode@redhat.com>2011-10-12 02:03:08 (GMT)
commitbcb27226b7e2e1d2819ba672f90e3a1e8e7c459d (patch) (side-by-side diff)
tree0546639c63c974c245f858b7aa3db0d2bde81230
parent9fffcda4c55a352c58d1c630d508ac0544ae1498 (diff)
downloadplymouth-bcb27226b7e2e1d2819ba672f90e3a1e8e7c459d.zip
plymouth-bcb27226b7e2e1d2819ba672f90e3a1e8e7c459d.tar.gz
text-progress-bar: plug fd leak
This plugs a fd leak in an error path
Diffstat (more/less context) (ignore whitespace changes)
-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 7ac0222..faf84a4 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);