diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-10 11:18:47 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-10 11:18:47 +0530 |
| commit | 564591aa8c2cc455a8fd69a1a2a00786448f2b17 (patch) | |
| tree | ce8146da613c1d5992f6a3ceed1db8a84e1178e8 | |
| parent | bcddd5c79306fcd7949c47f64d08400205463beb (diff) | |
main: fclose(in) if out is NULL
| -rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |
