=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/tbl.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/mandoc/tbl.c 2015/01/28 17:30:37 1.17 --- src/usr.bin/mandoc/tbl.c 2015/01/30 02:08:37 1.18 *************** *** 1,4 **** ! /* $OpenBSD: tbl.c,v 1.17 2015/01/28 17:30:37 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2015 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: tbl.c,v 1.18 2015/01/30 02:08:37 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2015 Ingo Schwarze *************** *** 89,95 **** { struct tbl_node *tbl; ! tbl = mandoc_calloc(1, sizeof(struct tbl_node)); tbl->line = line; tbl->pos = pos; tbl->parse = parse; --- 89,95 ---- { struct tbl_node *tbl; ! tbl = mandoc_calloc(1, sizeof(*tbl)); tbl->line = line; tbl->pos = pos; tbl->parse = parse; *************** *** 108,116 **** struct tbl_dat *dp; struct tbl_head *hp; ! while (NULL != (rp = tbl->first_row)) { tbl->first_row = rp->next; ! while (rp->first) { cp = rp->first; rp->first = cp->next; free(cp); --- 108,116 ---- struct tbl_dat *dp; struct tbl_head *hp; ! while ((rp = tbl->first_row) != NULL) { tbl->first_row = rp->next; ! while (rp->first != NULL) { cp = rp->first; rp->first = cp->next; free(cp); *************** *** 118,136 **** free(rp); } ! while (NULL != (sp = tbl->first_span)) { tbl->first_span = sp->next; ! while (sp->first) { dp = sp->first; sp->first = dp->next; ! if (dp->string) ! free(dp->string); free(dp); } free(sp); } ! while (NULL != (hp = tbl->first_head)) { tbl->first_head = hp->next; free(hp); } --- 118,135 ---- free(rp); } ! while ((sp = tbl->first_span) != NULL) { tbl->first_span = sp->next; ! while (sp->first != NULL) { dp = sp->first; sp->first = dp->next; ! free(dp->string); free(dp); } free(sp); } ! while ((hp = tbl->first_head) != NULL) { tbl->first_head = hp->next; free(hp); }