summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
Diffstat (limited to 'match.c')
-rw-r--r--match.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/match.c b/match.c
index 05b1a094..857e1df6 100644
--- a/match.c
+++ b/match.c
@@ -3739,6 +3739,8 @@ static val v_load(match_files_ctx *c)
parse_once(stream, name, &parser);
gc_state(gc);
+ close_stream(stream, nil);
+
if (parser.errors)
sem_error(specline, lit("~s: errors encountered in ~s"), sym, path, nao);
@@ -3773,8 +3775,11 @@ static val v_load(match_files_ctx *c)
}
}
} else {
- if (!read_eval_stream(stream, std_error, nil))
+ if (!read_eval_stream(stream, std_error, nil)){
+ close_stream(stream, nil);
sem_error(specline, lit("load: ~s contains errors"), path, nao);
+ }
+ close_stream(stream, nil);
return (sym == include_s) ? nil : next_spec_k;
}
}