mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 15:59:31 +02:00
shared: Don't leak file descriptor in shared/image-loader.c
This commit is contained in:
parent
444799adbb
commit
712f5f405e
1 changed files with 3 additions and 1 deletions
|
|
@ -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++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue