From b5ac29e2de82c1b0410af15cf511cecea73cafe5 Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 22 Dec 2010 19:34:47 +0000 Subject: [PATCH] Partial fix for bug 2088 --- lib/common/htmltable.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 94c3d0951..201ee80de 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -555,21 +555,17 @@ void free_html_text(htmltxt_t* t) if (!t) return; tl = t->paras; - if (tl) { + for (i = 0; i < t->nparas; i++) { ti = tl->items; - for (i = 0; i < t->nparas; i++) { - for (j = 0; j < tl->nitems; j++) { - if (ti->str) free (ti->str); - if (ti->font) free_html_font(ti->font); - if (ti->layout && ti->free_layout) ti->free_layout (ti->layout); - ti++; - } - tl++; - ti = tl->items; + for (j = 0; j < tl->nitems; j++) { + if (ti->str) free (ti->str); + if (ti->font) free_html_font(ti->font); + if (ti->layout && ti->free_layout) ti->free_layout (ti->layout); + ti++; } - if (ti != tl->items) free(tl->items); - if (tl != t->paras) free(t->paras); + tl++; } + if (t->paras) free(t->paras); free(t); } -- 2.40.0