From: ellson Date: Mon, 26 Jun 2006 21:14:04 +0000 (+0000) Subject: fix bug with cleanup of htmltable structures X-Git-Tag: LAST_LIBGRAPH~32^2~6254 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=632e8c4a5c287d2218fc03d6fabf1d26ff580006;p=graphviz fix bug with cleanup of htmltable structures --- diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 7f2fc7f4e..5b8cba9fc 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -498,8 +498,8 @@ void free_html_text(htmltxt_t* t) if (!t) return; tl = t->paras; + ti = tl->items; for (i = 0; i < t->nparas; i++) { - ti = tl->items; for (j = 0; j < tl->nitems; j++) { if (ti->str) free (ti->str); if (ti->xshow) free (ti->xshow); @@ -508,9 +508,12 @@ void free_html_text(htmltxt_t* t) ti++; } tl++; + ti = tl->items; } - free(tl->items); - free(t->paras); + if (ti != tl->items) + free(tl->items); + if (tl != t->paras) + free(t->paras); free(t); }