forked from len0rd/rockbox
Fix a file descriptor leak
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15906 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
34c2c1b7f6
commit
f0ecbf4506
1 changed files with 6 additions and 2 deletions
|
@ -803,12 +803,16 @@ int read_pfraw(char* filename)
|
||||||
int size = sizeof(struct bitmap) + sizeof( fb_data ) * bmph.width * bmph.height;
|
int size = sizeof(struct bitmap) + sizeof( fb_data ) * bmph.width * bmph.height;
|
||||||
|
|
||||||
int hid = rb->bufalloc(NULL, size, TYPE_BITMAP);
|
int hid = rb->bufalloc(NULL, size, TYPE_BITMAP);
|
||||||
if (hid < 0)
|
if (hid < 0) {
|
||||||
|
rb->close( fh );
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
struct bitmap *bm;
|
struct bitmap *bm;
|
||||||
if (rb->bufgetdata(hid, 0, (void *)&bm) < size)
|
if (rb->bufgetdata(hid, 0, (void *)&bm) < size) {
|
||||||
|
rb->close( fh );
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
bm->width = bmph.width;
|
bm->width = bmph.width;
|
||||||
bm->height = bmph.height;
|
bm->height = bmph.height;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue