diff options
| -rw-r--r-- | bk_text.c | 9 | ||||
| -rw-r--r-- | bk_xhtml.c | 8 | ||||
| -rw-r--r-- | input.c | 7 |
3 files changed, 22 insertions, 2 deletions
@@ -313,7 +313,14 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, * Tidy up */ fclose(fp); - sfree(conf.bullet.text); + { + int i; + sfree(conf.achapter.number_suffix); + for (i = 0; i < conf.nasect; i++) + sfree(conf.asect[i].number_suffix); + sfree(conf.asect); + sfree(conf.bullet.text); + } } /* @@ -28,6 +28,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <assert.h> #include "halibut.h" @@ -675,6 +676,13 @@ void xhtml_backend(paragraph *sourceform, keywordlist *in_keywords, } ientry->backend_data = NULL; } + { + int i; + sfree(conf.fchapter.number_suffix); + for (i = 0; i < conf.nfsect; i++) + sfree(conf.fsect[i].number_suffix); + sfree(conf.fsect); + } } static int xhtml_para_level(paragraph *p) @@ -547,7 +547,7 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx) { } already = FALSE; if (t.type == tok_eof) - return; + break; /* * Parse code paragraphs separately. @@ -1181,6 +1181,11 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx) { stk_free(parsestk); addpara(par, ret); } + + /* + * We break to here rather than returning, because otherwise + * this cleanup doesn't happen. + */ dtor(t); macrocleanup(macros); } |