From 1c90bf55b1874a2dec07eb6f2cacd623700859bd Mon Sep 17 00:00:00 2001 From: Shav Kinderlehrer Date: Mon, 1 May 2023 18:07:53 -0400 Subject: Fix memory leak and NULL-check error --- src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index fffdce5..eb9a2aa 100644 --- a/src/main.c +++ b/src/main.c @@ -1,12 +1,11 @@ -#include -#include -#include - #include "arg.h" #include "file.h" #include "process.h" #include "types.h" #include "util.h" +#include +#include +#include #define INVERT_T "\x1b[7m" #define UINVERT_T "\x1b[27m" @@ -77,6 +76,7 @@ void run(FILE *fp, char *filename, bool tty) { fwrite("\n", 1, 1, err); } free(f.buf); + free(f.lines); fflush(st); // prevent timing inconsistencies between st and err fflush(err); -- cgit v1.2.3