]> granicus.if.org Git - graphviz/commitdiff
Fix bug 1124
authorerg <devnull@localhost>
Mon, 30 Apr 2007 17:57:51 +0000 (17:57 +0000)
committererg <devnull@localhost>
Mon, 30 Apr 2007 17:57:51 +0000 (17:57 +0000)
lib/common/htmltable.c

index 5c1da78d8ffae15eb3c2a355618e457ee56f81e8..2e135b2a0900bddf14cdd602096fa5d91481e599 100644 (file)
@@ -573,22 +573,22 @@ void free_html_text(htmltxt_t* t)
     if (!t) return;
 
     tl = t->paras;
-    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->xshow) free (ti->xshow);
-           if (ti->font) free_html_font(ti->font);
-           if (ti->layout && ti->free_layout) ti->free_layout (ti->layout);
-           ti++;
-       }
-       tl++;
+    if (tl) {
        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->xshow) free (ti->xshow);
+               if (ti->font) free_html_font(ti->font);
+               if (ti->layout && ti->free_layout) ti->free_layout (ti->layout);
+               ti++;
+           }
+           tl++;
+           ti = tl->items;
+       }
+       if (ti != tl->items) free(tl->items);
+       if (tl != t->paras) free(t->paras);
     }
-    if (ti != tl->items)
-       free(tl->items);
-    if (tl != t->paras)
-       free(t->paras);
     free(t);
 }