Fix large memory leak introduced in the r4915 bidi changes.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 30 Nov 2004 13:39:58 +0000 (13:39 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 30 Nov 2004 13:39:58 +0000 (13:39 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@4936 cda61777-01e9-0310-a592-d414129be87e

terminal.c

index aa23196..5de2e4b 100644 (file)
@@ -4389,12 +4389,18 @@ static void term_bidi_cache_store(Terminal *term, int line, termchar *lbefore,
                term->post_bidi_cache[j].chars = NULL;
            term->pre_bidi_cache[j].width =
                term->post_bidi_cache[j].width = -1;
+           term->pre_bidi_cache[j].forward =
+               term->post_bidi_cache[j].forward = NULL;
+           term->pre_bidi_cache[j].backward =
+               term->post_bidi_cache[j].backward = NULL;
            j++;
        }
     }
 
     sfree(term->pre_bidi_cache[line].chars);
     sfree(term->post_bidi_cache[line].chars);
+    sfree(term->post_bidi_cache[line].forward);
+    sfree(term->post_bidi_cache[line].backward);
 
     term->pre_bidi_cache[line].width = width;
     term->pre_bidi_cache[line].chars = snewn(width, termchar);