summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mdoc.c b/mdoc.c
index 354a2e8f..48dedb0b 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -230,8 +230,6 @@ mdoc_free(struct mdoc *mdoc)
{
mdoc_free1(mdoc);
- if (mdoc->htab)
- mdoc_hash_free(mdoc->htab);
free(mdoc);
}
@@ -249,13 +247,12 @@ mdoc_alloc(void *data, int pflags, const struct mdoc_cb *cb)
if (cb)
(void)memcpy(&p->cb, cb, sizeof(struct mdoc_cb));
+ mdoc_hash_init();
+
p->data = data;
p->pflags = pflags;
- if (NULL == (p->htab = mdoc_hash_alloc())) {
- free(p);
- return(NULL);
- } else if (mdoc_alloc1(p))
+ if (mdoc_alloc1(p))
return(p);
free(p);
@@ -725,7 +722,7 @@ parsemacro(struct mdoc *m, int ln, char *buf)
return(1);
}
- if (MDOC_MAX == (c = mdoc_hash_find(m->htab, mac))) {
+ if (MDOC_MAX == (c = mdoc_hash_find(mac))) {
if ( ! macrowarn(m, ln, mac))
goto err;
return(1);