diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2022-04-14 16:43:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2022-04-14 16:43:43 +0000 |
commit | bddcaddd71aa306d9c5a606bc7ece6e2812925c5 (patch) | |
tree | cacfd28f1b6b5861bfa32dfeb9551fabcb76bf3c /demandoc.c | |
parent | 525559c24a4e02693f443d611b8920564a497f85 (diff) | |
download | mandoc-bddcaddd71aa306d9c5a606bc7ece6e2812925c5.tar.gz |
support for hunting memory leaks;
designed and written last autumn, polished today
Diffstat (limited to 'demandoc.c')
-rw-r--r-- | demandoc.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id$ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -26,6 +26,10 @@ #include <unistd.h> #include "mandoc.h" +#if DEBUG_MEMORY +#define DEBUG_NODEF +#include "mandoc_dbg.h" +#endif #include "roff.h" #include "man.h" #include "mdoc.h" @@ -47,6 +51,10 @@ main(int argc, char *argv[]) int ch, fd, i, list; extern int optind; +#if DEBUG_MEMORY + mandoc_dbg_init(argc, argv); +#endif + if (argc < 1) progname = "demandoc"; else if ((progname = strrchr(argv[0], '/')) == NULL) @@ -97,6 +105,9 @@ main(int argc, char *argv[]) mparse_free(mp); mchars_free(); +#if DEBUG_MEMORY + mandoc_dbg_finish(); +#endif return (int)MANDOCLEVEL_OK; } |