aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 8e06dd9..f404545 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,15 +53,15 @@ handle_file(const char *path)
free(temp_outpath);
FILE *in = fopen(inpath, "r");
- FILE *out = fopen(outpath, "w");
-
if (in == NULL) {
printf("Failed to open %s\n", inpath);
return;
}
+ FILE *out = fopen(outpath, "w");
if (out == NULL) {
printf("Failed to open %s\n", outpath);
+ fclose(in);
return;
}