From 7b1567cc9dd6302be56691a1191540f6c1f6e4b3 Mon Sep 17 00:00:00 2001 From: Brad Fish Date: Fri, 26 Nov 2021 12:28:49 -0800 Subject: [PATCH] Close file on allocation failure --- qoi.h | 1 + 1 file changed, 1 insertion(+) diff --git a/qoi.h b/qoi.h index f12b3af6..d188208f 100644 --- a/qoi.h +++ b/qoi.h @@ -514,6 +514,7 @@ void *qoi_read(const char *filename, int *out_w, int *out_h, int channels) { void *data = QOI_MALLOC(size); if (!data) { + fclose(f); return NULL; }