mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
progs/samples: Fix memory leak if fopen fails in rgbtoppm.c.
This commit is contained in:
parent
6212c8103a
commit
412aeeed1c
1 changed files with 2 additions and 1 deletions
|
|
@ -86,7 +86,8 @@ static ImageRec *ImageOpen(char *fileName)
|
|||
exit(1);
|
||||
}
|
||||
if ((image->file = fopen(fileName, "rb")) == NULL) {
|
||||
return NULL;
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fread(image, 1, 12, image->file);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue