summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bk_text.c9
-rw-r--r--bk_xhtml.c8
-rw-r--r--input.c7
3 files changed, 22 insertions, 2 deletions
diff --git a/bk_text.c b/bk_text.c
index b682b42..1c8cfb9 100644
--- a/bk_text.c
+++ b/bk_text.c
@@ -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);
+ }
}
/*
diff --git a/bk_xhtml.c b/bk_xhtml.c
index 22173d5..edab934 100644
--- a/bk_xhtml.c
+++ b/bk_xhtml.c
@@ -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)
diff --git a/input.c b/input.c
index 2e0dabf..d4ecaeb 100644
--- a/input.c
+++ b/input.c
@@ -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);
}