From 398d2cab6988e20c59e7037ff7ef551540339abb Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 5 Oct 2025 17:52:33 -0400 Subject: Fix a bunch of issues with optional types --- src/stdlib/paths.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/stdlib/paths.c') 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); -- cgit v1.2.3