aboutsummaryrefslogtreecommitdiff
path: root/src/grab.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-22 19:11:20 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-22 19:11:20 +0100
commit745e4e3c83b1688d205d5a9a54ef41fbb62efce4 (patch)
tree5a82cec65eeb949e72197c652a22272de17615bd /src/grab.c
parent0ac2fd6a3c27e046340efe61beb5137953b6930a (diff)
Fix memory leaks
Diffstat (limited to 'src/grab.c')
-rw-r--r--src/grab.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/grab.c b/src/grab.c
index 1ba3417..b391909 100644
--- a/src/grab.c
+++ b/src/grab.c
@@ -224,6 +224,7 @@ main(int argc, char **argv)
}
if (ferror(flist))
warn("getdelim");
+ fclose(flist);
#else
if (argc == 1)
grab(ops, stdin, "-");
@@ -244,6 +245,9 @@ main(int argc, char **argv)
#endif
#ifdef GRAB_DEBUG
+# if GIT_GRAB
+ free(entry);
+# endif
for (size_t i = 0; i < ops.len; i++)
regfree(&ops.buf[i].pat);
free(ops.buf);
@@ -639,6 +643,7 @@ putm(struct sv sv, struct matches *ms, const char *filename)
if (!(sflag && sv.p[sv.len - 1] == '\n'))
putchar(zflag ? '\0' : '\n');
+ free(valid.buf);
}
void