diff options
Diffstat (limited to 'src/stdlib/paths.c')
| -rw-r--r-- | src/stdlib/paths.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c index d630ad7d..74526f7d 100644 --- a/src/stdlib/paths.c +++ b/src/stdlib/paths.c @@ -690,10 +690,11 @@ OptionalClosure_t Path$by_line(Path_t path) { // be closed by GC finalizers. GC_gcollect(); f = fopen(path_str, "r"); - if (f == NULL) return NONE_CLOSURE; } } + if (f == NULL) return NONE_CLOSURE; + FILE **wrapper = GC_MALLOC(sizeof(FILE *)); *wrapper = f; GC_register_finalizer(wrapper, (void *)_line_reader_cleanup, NULL, NULL, NULL); |
