From 02d6c7715e097ea8fd2cfda70001af6fad6ddb22 Mon Sep 17 00:00:00 2001
From: anonymouspage <123-anonymouspage@users.noreply.gitlab.synchro.net>
Date: Tue, 18 Oct 2022 15:21:22 -0700
Subject: [PATCH] Do not leak fill buffer on each invocation

This fixes a large memory leak in ciolib_movetext(). Even a couple
pages worth of ascii art would leak a few megabytes of memory. The
memory would not be reclaimed until the application was shutdown.
---
 src/conio/ciolib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conio/ciolib.c b/src/conio/ciolib.c
index dbe5f3360f..a54baa628f 100644
--- a/src/conio/ciolib.c
+++ b/src/conio/ciolib.c
@@ -577,6 +577,7 @@ CIOLIBEXPORT int ciolib_movetext(int sx, int sy, int ex, int ey, int dx, int dy)
 			goto fail;
 	}
 
+	free(buf);
 	return(1);
 
 fail:
-- 
GitLab