summaryrefslogtreecommitdiff
path: root/src/grijp.c
diff options
context:
space:
mode:
authorLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-08-07 23:04:04 +0200
committerLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-08-07 23:04:04 +0200
commitbceb61b88979dc8fa0d4468354ce55cca833fc49 (patch)
tree5060938243ffd7778c88472d1bb1d20e0bac58c2 /src/grijp.c
parenta0962d7311c057229a25ae5f30fc3e9645d6ff24 (diff)
grijp: close streams
Diffstat (limited to 'src/grijp.c')
-rw-r--r--src/grijp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/grijp.c b/src/grijp.c
index 9767c46..898852c 100644
--- a/src/grijp.c
+++ b/src/grijp.c
@@ -127,6 +127,7 @@ static int process_regex(char *fname, bool isstdin) {
for (size_t i = 0; i < npat; i++) regfree(regexps[i]);
free(regexps);
+ if (!isstdin) fclose(stream);
return 0;
}
@@ -152,6 +153,7 @@ static int process_fixed(char *fname, bool isstdin) {
for (size_t i = 0; i < npat; i++) free(patterns[i]);
free(patterns);
+ if (!isstdin) fclose(stream);
return 0;
}