Skip to content

Commit

Permalink
Merge pull request phoboslab#31 from vec4f/bug/qoi_read/fclose
Browse files Browse the repository at this point in the history
Close file on allocation failure in `qoi_read()`
  • Loading branch information
phoboslab authored Nov 27, 2021
2 parents 5506399 + 7b1567c commit be8d23c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions qoi.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ void *qoi_read(const char *filename, qoi_desc *desc, int channels) {

void *data = QOI_MALLOC(size);
if (!data) {
fclose(f);
return NULL;
}

Expand Down

0 comments on commit be8d23c

Please sign in to comment.