diff --git a/repl/main.c b/repl/main.c index 519b16e..7099cd4 100644 --- a/repl/main.c +++ b/repl/main.c @@ -38,6 +38,7 @@ unsigned char* readFile(char* path, int* size) { //read the file if (fread(buffer, sizeof(unsigned char), *size, file) < (unsigned int)(*size)) { fclose(file); + free(buffer); *size = -2; //singal a read error return NULL; }