diff --git a/src/main.c b/src/main.c index db9aa34..2bf86fd 100644 --- a/src/main.c +++ b/src/main.c @@ -42,6 +42,15 @@ init(int argc, char **argv) static void finish() { + // Close any file sources we had opened + for (int i = 1; i <= OPTION_MAX_DISKS; i++) { + FILE *stream = option_get_input(i); + + if (stream != NULL) { + fclose(stream); + } + } + log_close(); }