summaryrefslogtreecommitdiff
path: root/apps/plugins/pictureflow.c
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-12-10 15:58:02 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-12-10 15:58:02 +0000
commitf0ecbf45060e695cd981b3a308d065cc3a2225f7 (patch)
tree5caad5e7e0839f47fe748f6c1629947cfc14531f /apps/plugins/pictureflow.c
parent34c2c1b7f6533c68994703c29a2cd9e7266646cd (diff)
downloadrockbox-f0ecbf45060e695cd981b3a308d065cc3a2225f7.tar.gz
rockbox-f0ecbf45060e695cd981b3a308d065cc3a2225f7.zip
Fix a file descriptor leak
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15906 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pictureflow.c')
-rw-r--r--apps/plugins/pictureflow.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c
index 380070bdd0..9d4294ead1 100644
--- a/apps/plugins/pictureflow.c
+++ b/apps/plugins/pictureflow.c
@@ -803,12 +803,16 @@ int read_pfraw(char* filename)
803 int size = sizeof(struct bitmap) + sizeof( fb_data ) * bmph.width * bmph.height; 803 int size = sizeof(struct bitmap) + sizeof( fb_data ) * bmph.width * bmph.height;
804 804
805 int hid = rb->bufalloc(NULL, size, TYPE_BITMAP); 805 int hid = rb->bufalloc(NULL, size, TYPE_BITMAP);
806 if (hid < 0) 806 if (hid < 0) {
807 rb->close( fh );
807 return -1; 808 return -1;
809 }
808 810
809 struct bitmap *bm; 811 struct bitmap *bm;
810 if (rb->bufgetdata(hid, 0, (void *)&bm) < size) 812 if (rb->bufgetdata(hid, 0, (void *)&bm) < size) {
813 rb->close( fh );
811 return -1; 814 return -1;
815 }
812 816
813 bm->width = bmph.width; 817 bm->width = bmph.width;
814 bm->height = bmph.height; 818 bm->height = bmph.height;