From bac2215fb6de3930f6ae68a62581260d21337318 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Wed, 11 Feb 2004 03:54:28 +0000 Subject: Fix several memory leaks git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2153 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pbx.c') diff --git a/pbx.c b/pbx.c index 84f601644..27a9b1fe2 100755 --- a/pbx.c +++ b/pbx.c @@ -4066,6 +4066,7 @@ void __ast_context_destroy(struct ast_context *con, char *registrar, int lock) struct ast_include *tmpi, *tmpil= NULL; struct ast_sw *sw, *swl= NULL; struct ast_exten *e, *el, *en; + struct ast_ignorepat *ipi, *ipl = NULL; if (lock) ast_mutex_lock(&conlock); tmp = contexts; @@ -4090,7 +4091,12 @@ void __ast_context_destroy(struct ast_context *con, char *registrar, int lock) tmpil = tmpi; tmpi = tmpi->next; free(tmpil); - tmpil = tmpi; + } + for (ipi = tmp->ignorepats; ipi; ) { + /* Free includes */ + ipl = ipi; + ipi = ipi->next; + free(ipl); } for (sw = tmp->alts; sw; ) { swl = sw; -- cgit v1.2.3