mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-05-05 16:30:17 +10:00
Fixed a repl util error case
This commit is contained in:
@@ -38,6 +38,7 @@ unsigned char* readFile(char* path, int* size) {
|
|||||||
//read the file
|
//read the file
|
||||||
if (fread(buffer, sizeof(unsigned char), *size, file) < (unsigned int)(*size)) {
|
if (fread(buffer, sizeof(unsigned char), *size, file) < (unsigned int)(*size)) {
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
free(buffer);
|
||||||
*size = -2; //singal a read error
|
*size = -2; //singal a read error
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user