Merge pull request #31 from vec4f/bug/qoi_read/fclose
Close file on allocation failure in `qoi_read()`
This commit is contained in:
commit
be8d23c574
1
qoi.h
1
qoi.h
@ -556,6 +556,7 @@ void *qoi_read(const char *filename, qoi_desc *desc, int channels) {
|
|||||||
|
|
||||||
void *data = QOI_MALLOC(size);
|
void *data = QOI_MALLOC(size);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
fclose(f);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user