From 792b9c4c5a44280611945547a57ac9e48af5baf1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 14 Apr 2022 16:43:43 +0000 Subject: support for hunting memory leaks; designed and written last autumn, polished today --- mandocd.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'mandocd.c') diff --git a/mandocd.c b/mandocd.c index 60e40fed..ccc846bd 100644 --- a/mandocd.c +++ b/mandocd.c @@ -1,7 +1,7 @@ -/* $Id: mandocd.c,v 1.12 2020/06/14 23:40:31 schwarze Exp $ */ +/* $Id: mandocd.c,v 1.13 2022/04/14 16:43:44 schwarze Exp $ */ /* * Copyright (c) 2017 Michael Stapelberg - * Copyright (c) 2017, 2019 Ingo Schwarze + * Copyright (c) 2017, 2019, 2021 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 @@ -35,6 +35,10 @@ #include #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; } -- cgit v1.2.3