adding fclose before return
This commit is contained in:
parent
7202184ee0
commit
d598c88fb3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user