adding fclose before return

This commit is contained in:
Bimba Shrestha 2020-04-03 13:31:47 -07:00
parent 7202184ee0
commit d598c88fb3

View File

@ -105,6 +105,7 @@ static char* readFile(const char* filename, size_t* size) {
bytes_read = fread(buf, 1, *size, f);
if (bytes_read != *size) {
fprintf(stderr, "failed to read whole file\n");
fclose(f);
free(buf);
return NULL;
}