summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-08-09 16:11:33 +0200
committerLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-08-09 16:11:33 +0200
commitbdf938c57947d37cc19870dc80c9a22a8b653f5e (patch)
tree473301b51870d8817ce9ae0282bf15b7e16716a8
parente97a7b59139232bc44101c0ea7815ceb100be9de (diff)
grijp: fix leak
-rw-r--r--src/grijp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/grijp.c b/src/grijp.c
index 79b0d11..0884be6 100644
--- a/src/grijp.c
+++ b/src/grijp.c
@@ -197,12 +197,12 @@ int entry_grijp(int argc, char **argv) {
int res = 0;
if (fixed) {
res = loop_args(args, process);
- for (size_t i = 0; i < npat; i++) free(patterns[i]);
} else {
compile_regexps();
res = loop_args(args, process);
for (size_t i = 0; i < npat; i++) regfree(patterns[i]);
}
+ for (size_t i = 0; i < npat; i++) free(patterns[i]);
free(patterns);
return res;
}