projects
/
profile
/
ivi
/
weston.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
444799a
)
shared: Don't leak file descriptor in shared/image-loader.c
author
Martin Olsson
<martin@minimum.se>
Sun, 8 Jul 2012 01:03:41 +0000
(
03:03
+0200)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Mon, 9 Jul 2012 21:50:44 +0000
(17:50 -0400)
shared/image-loader.c
patch
|
blob
|
history
diff --git
a/shared/image-loader.c
b/shared/image-loader.c
index
a3218df
..
b47c1a7
100644
(file)
--- a/
shared/image-loader.c
+++ b/
shared/image-loader.c
@@
-359,8
+359,10
@@
load_image(const char *filename)
if (fp == NULL)
return NULL;
- if (fread(header, sizeof header, 1, fp) != 1)
+ if (fread(header, sizeof header, 1, fp) != 1) {
+ fclose(fp);
return NULL;
+ }
rewind(fp);
for (i = 0; i < ARRAY_LENGTH(loaders); i++) {