From 77183303e3452c6422b993bd87fea2154b8cd3b2 Mon Sep 17 00:00:00 2001 From: Arkaprabha Chakraborty Date: Tue, 30 May 2023 01:50:15 +0530 Subject: [PATCH] Bug fix! Stupid old me forgot to free the 2nd-dimensional pointers; causing memory leaks. --- torus.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/torus.c b/torus.c index ef029fd..47c81b5 100644 --- a/torus.c +++ b/torus.c @@ -173,6 +173,9 @@ void runner(bool dynamic, bool limit, int frames) { for (int i = 0; !limit || i < frames; ++i) { if (dynamic && i % 32 == 0 && term_size - terminal_size() != 0) { // Frees the old frame buffer + for (int i = 0; i < term_size; ++i) { + free(buffer[i]); + } free(buffer); // Reallocates the frame buffer as per new terminal size