summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-20 17:58:32 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-20 17:58:32 +0000
commitc7d0e41cb85264a7663d50fa86c0ea461319968a (patch)
tree1ab5b7e1486bce2cfd7461346c2cfae674f80fff
parent66df5a6c218cbac7a87d265cb195f74c8a812bc2 (diff)
downloadrsyslog-c7d0e41cb85264a7663d50fa86c0ea461319968a.tar.gz
rsyslog-c7d0e41cb85264a7663d50fa86c0ea461319968a.tar.xz
rsyslog-c7d0e41cb85264a7663d50fa86c0ea461319968a.zip
made debug module free some memory on exit to make memory debugger happy
-rw-r--r--debug.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/debug.c b/debug.c
index 74dffe9f..39e7fc4f 100644
--- a/debug.c
+++ b/debug.c
@@ -1304,6 +1304,7 @@ finalize_it:
rsRetVal dbgClassExit(void)
{
+ dbgFuncDBListEntry_t *pFuncDBListEtry, *pToDel;
pthread_key_delete(keyCallStack);
if(bPrintAllDebugOnExit)
@@ -1311,6 +1312,18 @@ rsRetVal dbgClassExit(void)
if(altdbg != NULL)
fclose(altdbg);
+
+ /* now free all of our memory to make the memory debugger happy... */
+ pFuncDBListEtry = pFuncDBListRoot;
+ while(pFuncDBListEtry != NULL) {
+ pToDel = pFuncDBListEtry;
+ pFuncDBListEtry = pFuncDBListEtry->pNext;
+ free(pToDel->pFuncDB->file);
+ free(pToDel->pFuncDB->func);
+ free(pToDel->pFuncDB);
+ free(pToDel);
+ }
+
return RS_RET_OK;
}
/* vi:set ai: