From 38705fa09bd769ea0416f69889d32f6d36ae5940 Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Tue, 27 Jul 2021 00:48:45 -0400 Subject: [PATCH] `cat`: close file descriptor in `concatFileToStdoutWithOptions`. otherwise, it was causing memory leaks. --- src/cat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cat.c b/src/cat.c index d259806..a02228a 100644 --- a/src/cat.c +++ b/src/cat.c @@ -54,6 +54,7 @@ static int concatFileToStdoutWithOptions(char *file, bool showLineEnds) { printf("%s", contents); } free(contents); + fclose(fp); return 0; }