=================================================================== RCS file: /cvs/mandoc/mdoc.c,v retrieving revision 1.155 retrieving revision 1.157 diff -u -p -r1.155 -r1.157 --- mandoc/mdoc.c 2010/07/01 23:01:47 1.155 +++ mandoc/mdoc.c 2010/07/04 22:04:04 1.157 @@ -1,6 +1,7 @@ -/* $Id: mdoc.c,v 1.155 2010/07/01 23:01:47 kristaps Exp $ */ +/* $Id: mdoc.c,v 1.157 2010/07/04 22:04:04 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2010 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -518,12 +519,21 @@ static void mdoc_node_free(struct mdoc_node *p) { + /* + * XXX: if these end up being problematic in terms of memory + * management and dereferencing freed blocks, then make them + * into reference-counted double-pointers. + */ + if (MDOC_Bd == p->tok && MDOC_BLOCK == p->type) if (p->data.Bd) free(p->data.Bd); if (MDOC_Bl == p->tok && MDOC_BLOCK == p->type) if (p->data.Bl) free(p->data.Bl); + if (MDOC_Bf == p->tok && MDOC_HEAD == p->type) + if (p->data.Bf) + free(p->data.Bf); if (p->string) free(p->string);