| author | James 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) |
| commit | bcb27226b7e2e1d2819ba672f90e3a1e8e7c459d (patch) (side-by-side diff) | |
| tree | 0546639c63c974c245f858b7aa3db0d2bde81230 | |
| parent | 9fffcda4c55a352c58d1c630d508ac0544ae1498 (diff) | |
| download | plymouth-bcb27226b7e2e1d2819ba672f90e3a1e8e7c459d.zip plymouth-bcb27226b7e2e1d2819ba672f90e3a1e8e7c459d.tar.gz | |
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.c | 4 |
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); |
