From 5348d27843f8194fa62b6a6b549477c957db6e2b Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Tue, 10 Sep 2013 12:43:11 -0400 Subject: [PATCH] Fix 2363 --- lib/common/htmlparse.y | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/common/htmlparse.y b/lib/common/htmlparse.y index 90dd3eda0..880e6fd69 100644 --- a/lib/common/htmlparse.y +++ b/lib/common/htmlparse.y @@ -206,18 +206,27 @@ appendFLineList (int v) Dt_t *ilist = HTMLstate.fitemList; cnt = dtsize(ilist); - ln->lp.nitems = cnt; ln->lp.just = v; if (cnt) { int i = 0; + ln->lp.nitems = cnt; ln->lp.items = N_NEW(cnt, textpara_t); fi = (fitem*)dtflatten(ilist); for (; fi; fi = (fitem*)dtlink(fitemList,(Dtlink_t*)fi)) { - ln->lp.items[i] = fi->ti; + /* NOTE: When fitemList is closed, it uses free_item, which only frees the container, + * not the contents, so this copy is safe. + */ + ln->lp.items[i] = fi->ti; i++; } } + else { + ln->lp.items = NEW(textpara_t); + ln->lp.nitems = 1; + ln->lp.items[0].str = strdup(""); + ln->lp.items[0].font = dupFont (HTMLstate.fontstack->cfont); + } dtclear(ilist); -- 2.40.0