]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fix memory leak in textbox
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Jul 2008 12:45:36 +0000 (14:45 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Jul 2008 12:45:36 +0000 (14:45 +0200)
textbox.c

index 6b83516ad77c33d1bbd86797ed62172ab29e2481..639c9a971772f7f1d9bab56b46eb5a5588292bec 100644 (file)
--- a/textbox.c
+++ b/textbox.c
@@ -301,6 +301,10 @@ void newtTextboxSetText(newtComponent co, const char * text) {
     int badness, height;
 
     if (tb->lines) {
+       int i;
+
+       for (i = 0; i < tb->numLines; i++) 
+           free(tb->lines[i]);
        free(tb->lines);
        tb->linesAlloced = tb->numLines = 0;
     }