From f0ecbf45060e695cd981b3a308d065cc3a2225f7 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Mon, 10 Dec 2007 15:58:02 +0000 Subject: Fix a file descriptor leak git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15906 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/pictureflow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apps') 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) int size = sizeof(struct bitmap) + sizeof( fb_data ) * bmph.width * bmph.height; int hid = rb->bufalloc(NULL, size, TYPE_BITMAP); - if (hid < 0) + if (hid < 0) { + rb->close( fh ); return -1; + } struct bitmap *bm; - if (rb->bufgetdata(hid, 0, (void *)&bm) < size) + if (rb->bufgetdata(hid, 0, (void *)&bm) < size) { + rb->close( fh ); return -1; + } bm->width = bmph.width; bm->height = bmph.height; -- cgit v1.2.3