diff options
| author | Simon Tatham <anakin@pobox.com> | 2001-12-04 19:03:42 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2001-12-04 19:03:42 +0000 |
| commit | 7f379058ad6686095acc2e8bfbcadc360e08b0f8 (patch) | |
| tree | 5319eec0a5326745198e13ba8ce2f70881a7fffe | |
| parent | ec2134d20f485b8fbf75632edf895f3aa9073227 (diff) | |
| download | halibut-7f379058ad6686095acc2e8bfbcadc360e08b0f8.zip halibut-7f379058ad6686095acc2e8bfbcadc360e08b0f8.tar.gz halibut-7f379058ad6686095acc2e8bfbcadc360e08b0f8.tar.bz2 halibut-7f379058ad6686095acc2e8bfbcadc360e08b0f8.tar.xz | |
Fix memory management error (don't free a linked list by freeing x
and _then_ setting x = x->next!).
[originally from svn r1445]
| -rw-r--r-- | bk_xhtml.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -596,11 +596,14 @@ void xhtml_backend(paragraph *sourceform, keywordlist *in_keywords, index *in_id xhtml_do_index(); /* release file, section, index data structures */ - for (xsect = topsection; xsect!=NULL; xsect=xsect->chain) { + xsect = topsection; + while (xsect) { + xhtmlsection *tmp = xsect->chain; if (xsect->fragment) { sfree(xsect->fragment); } sfree(xsect); + xsect = tmp; } xhtml_free_file(topfile); for (ti = 0; (ientry=(indexentry *)index234(idx->entries, ti))!=NULL; ti++) { |