returning on null check
This commit is contained in:
parent
d598c88fb3
commit
1d267dc5d6
@ -100,6 +100,8 @@ static char* readFile(const char* filename, size_t* size) {
|
||||
buf = malloc(*size);
|
||||
if (buf == NULL) {
|
||||
fprintf(stderr, "malloc failed\n");
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bytes_read = fread(buf, 1, *size, f);
|
||||
|
Loading…
Reference in New Issue
Block a user