]> granicus.if.org Git - graphviz/commitdiff
Partial fix for bug 2088
authorerg <devnull@localhost>
Wed, 22 Dec 2010 19:34:47 +0000 (19:34 +0000)
committererg <devnull@localhost>
Wed, 22 Dec 2010 19:34:47 +0000 (19:34 +0000)
lib/common/htmltable.c

index 94c3d0951cf33c4089b8aa15f488136eda43a41b..201ee80dece38ca6205ed3b2714f52d9d2eae2cf 100644 (file)
@@ -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);
 }