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 /mandocd.c | |
parent | 525559c24a4e02693f443d611b8920564a497f85 (diff) | |
download | mandoc-bddcaddd71aa306d9c5a606bc7ece6e2812925c5.tar.gz |
support for hunting memory leaks;
designed and written last autumn, polished today
Diffstat (limited to 'mandocd.c')
-rw-r--r-- | mandocd.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1,7 +1,7 @@ -/* $Id$ */ +/* $Id$ */ /* * Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org> - * Copyright (c) 2017, 2019 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2017, 2019, 2021 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -35,6 +35,10 @@ #include <unistd.h> #include "mandoc.h" +#if DEBUG_MEMORY +#define DEBUG_NODEF 1 +#include "mandoc_dbg.h" +#endif #include "roff.h" #include "mdoc.h" #include "man.h" @@ -129,6 +133,10 @@ main(int argc, char *argv[]) int state, opt; enum outt outtype; +#if DEBUG_MEMORY + mandoc_dbg_init(argc, argv); +#endif + defos = NULL; outtype = OUTT_ASCII; while ((opt = getopt(argc, argv, "I:T:")) != -1) { @@ -240,6 +248,9 @@ main(int argc, char *argv[]) } mparse_free(parser); mchars_free(); +#if DEBUG_MEMORY + mandoc_dbg_finish(); +#endif return state == -1 ? 1 : 0; } |