summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/util.c b/util.c
index 5d3fefe..a2f60de 100644
--- a/util.c
+++ b/util.c
@@ -157,6 +157,11 @@ void* file_raw(char *path, uint32_t *size)
157 157
158 fseek(file, 0, SEEK_END); 158 fseek(file, 0, SEEK_END);
159 len = ftell(file); 159 len = ftell(file);
160 if(len <= 0)
161 {
162 fclose(file);
163 return NULL;
164 }
160 data = malloc(len); 165 data = malloc(len);
161 if(!data) { 166 if(!data) {
162 fclose(file); 167 fclose(file);