=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/read.c,v retrieving revision 1.132 retrieving revision 1.133 diff -c -r1.132 -r1.133 *** src/usr.bin/mandoc/read.c 2017/02/03 17:55:36 1.132 --- src/usr.bin/mandoc/read.c 2017/02/03 18:18:08 1.133 *************** *** 1,4 **** ! /* $OpenBSD: read.c,v 1.132 2017/02/03 17:55:36 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: read.c,v 1.133 2017/02/03 18:18:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze *************** *** 43,50 **** #define REPARSE_LIMIT 1000 struct mparse { - struct roff_man *man; /* man parser */ struct roff *roff; /* roff parser (!NULL) */ char *sodest; /* filename pointed to by .so */ const char *file; /* filename of current input file */ struct buf *primary; /* buffer currently being parsed */ --- 43,50 ---- #define REPARSE_LIMIT 1000 struct mparse { struct roff *roff; /* roff parser (!NULL) */ + struct roff_man *man; /* man parser */ char *sodest; /* filename pointed to by .so */ const char *file; /* filename of current input file */ struct buf *primary; /* buffer currently being parsed */ *************** *** 811,823 **** { roff_reset(curp->roff); roff_man_reset(curp->man); if (curp->secondary) curp->secondary->sz = 0; curp->file_status = MANDOCLEVEL_OK; - - free(curp->sodest); - curp->sodest = NULL; curp->gzip = 0; } --- 811,824 ---- { roff_reset(curp->roff); roff_man_reset(curp->man); + + free(curp->sodest); + curp->sodest = NULL; + if (curp->secondary) curp->secondary->sz = 0; curp->file_status = MANDOCLEVEL_OK; curp->gzip = 0; } *************** *** 826,833 **** { roff_man_free(curp->man); ! if (curp->roff) ! roff_free(curp->roff); if (curp->secondary) free(curp->secondary->buf); --- 827,833 ---- { roff_man_free(curp->man); ! roff_free(curp->roff); if (curp->secondary) free(curp->secondary->buf);