=================================================================== RCS file: /cvs/docbook2mdoc/node.c,v retrieving revision 1.7 retrieving revision 1.9 diff -u -p -r1.7 -r1.9 --- docbook2mdoc/node.c 2019/04/10 14:22:37 1.7 +++ docbook2mdoc/node.c 2019/04/12 04:39:24 1.9 @@ -1,4 +1,4 @@ -/* $Id: node.c,v 1.7 2019/04/10 14:22:37 schwarze Exp $ */ +/* $Id: node.c,v 1.9 2019/04/12 04:39:24 schwarze Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * Copyright (c) 2019 Ingo Schwarze @@ -74,6 +74,20 @@ attrval_parse(const char *name) return val; } +struct pnode * +pnode_alloc(struct pnode *np) +{ + struct pnode *n; + + if ((n = calloc(1, sizeof(*n))) != NULL) { + TAILQ_INIT(&n->childq); + TAILQ_INIT(&n->attrq); + if ((n->parent = np) != NULL) + TAILQ_INSERT_TAIL(&np->childq, n, child); + } + return n; +} + /* * Recursively free a node (NULL is ok). */ @@ -95,7 +109,7 @@ pnode_free(struct pnode *n) free(a->rawval); free(a); } - free(n->real); + free(n->b); free(n); }