From 745e4e3c83b1688d205d5a9a54ef41fbb62efce4 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 22 Jan 2024 19:11:20 +0100 Subject: Fix memory leaks --- src/grab.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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 -- cgit v1.2.3