From 1a465c2305ad37d8a67a0e484859753f23755741 Mon Sep 17 00:00:00 2001 From: Rupa Schomaker Date: Thu, 9 Jul 2009 16:41:49 +0000 Subject: [PATCH] don't free the pool if it hasn't been created git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14174 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_cidlookup/mod_cidlookup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_cidlookup/mod_cidlookup.c b/src/mod/applications/mod_cidlookup/mod_cidlookup.c index 0c2b54357a..72ed3be956 100755 --- a/src/mod/applications/mod_cidlookup/mod_cidlookup.c +++ b/src/mod/applications/mod_cidlookup/mod_cidlookup.c @@ -443,8 +443,10 @@ SWITCH_STANDARD_APP(cidlookup_app_function) switch_goto_status(SWITCH_STATUS_SUCCESS, done); done: - switch_event_destroy(&event); - if (!session) { + if (event) { + switch_event_destroy(&event); + } + if (!session && pool) { switch_core_destroy_memory_pool(&pool); } } @@ -510,8 +512,10 @@ usage: done: switch_safe_free(mydata); - switch_event_destroy(&event); - if (!session) { + if (event) { + switch_event_destroy(&event); + } + if (!session && pool) { switch_core_destroy_memory_pool(&pool); } return status;