From 2caeeb273352bea6f1546597b109890149160966 Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Tue, 11 Nov 2014 22:28:25 -0500
Subject: [PATCH] *fixed memory leak in text_setto as reported by Jonathan
 Wilkes

---
 pd/src/g_text.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pd/src/g_text.c b/pd/src/g_text.c
index 81ff821d9..913fa75db 100644
--- a/pd/src/g_text.c
+++ b/pd/src/g_text.c
@@ -2354,6 +2354,7 @@ void text_setto(t_text *x, t_glist *glist, char *buf, int bufsize, int pos)
                 //just retext it
                 t_rtext *yr = glist_findrtext(glist, x);
                 if (yr) rtext_retext(yr);
+                binbuf_free(b);
             }
         }
         else  /* normally, just destroy the old one and make a new one. */
@@ -2389,6 +2390,7 @@ void text_setto(t_text *x, t_glist *glist, char *buf, int bufsize, int pos)
                 //fprintf(stderr,"just retext it\n");
                 t_rtext *yr = glist_findrtext(glist, x);
                 if (yr) rtext_retext(yr);
+                binbuf_free(b);
             }
         }
             /* if we made a new "pd" or changed a window name,
-- 
GitLab