diff options
| author | Simon Tatham <anakin@pobox.com> | 1999-07-31 18:44:53 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 1999-07-31 18:44:53 +0000 |
| commit | 0d14833a9c76c51cc7417d8fd60bec9d92714b8e (patch) | |
| tree | c0716d398e83bc746baad088d5dfc215d5fea483 /malloc.c | |
| parent | 4c8c2b256ed01563a98b4cd820dc8ffef30d7fc1 (diff) | |
| download | halibut-0d14833a9c76c51cc7417d8fd60bec9d92714b8e.zip halibut-0d14833a9c76c51cc7417d8fd60bec9d92714b8e.tar.gz halibut-0d14833a9c76c51cc7417d8fd60bec9d92714b8e.tar.bz2 halibut-0d14833a9c76c51cc7417d8fd60bec9d92714b8e.tar.xz | |
Further development work. Parser nearly finished
[originally from svn r187]
Diffstat (limited to 'malloc.c')
| -rw-r--r-- | malloc.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -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); + } } |