From 0d14833a9c76c51cc7417d8fd60bec9d92714b8e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 31 Jul 1999 18:44:53 +0000 Subject: Further development work. Parser nearly finished [originally from svn r187] --- malloc.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'malloc.c') diff --git a/malloc.c b/malloc.c index cf0f2e0..7d33085 100644 --- a/malloc.c +++ b/malloc.c @@ -35,5 +35,29 @@ void *srealloc(void *p, int size) { q = malloc(size); if (!q) fatal(err_nomemory); - return p; + return q; +} + +/* + * Free a linked list of words + */ +void free_word_list(word *w) { + word *t; + while (w) { + t = w; + w = w->next; + sfree(t); + } +} + +/* + * Free a linked list of paragraphs + */ +void free_para_list(paragraph *p) { + paragraph *t; + while (p) { + t = p; + p = p->next; + sfree(t); + } } -- cgit v1.1