diff --git a/src/util.c b/src/util.c index 02901ba..4560436 100644 --- a/src/util.c +++ b/src/util.c @@ -26,6 +26,7 @@ long readFile(char *name, void **buffer) { } } + *buffer = malloc(sizeof chunk); while ((bytesRead = fread(chunk, 1, sizeof chunk, file)) > 0) { unsigned char *reallocated = realloc(*buffer, fileLen + bytesRead); if (reallocated) {