From: Rupa Schomaker Date: Thu, 9 Jul 2009 16:41:49 +0000 (+0000) Subject: don't free the pool if it hasn't been created X-Git-Tag: v1.0.4~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a465c2305ad37d8a67a0e484859753f23755741;p=thirdparty%2Ffreeswitch.git 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 --- 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;