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
This commit is contained in:
Rupa Schomaker 2009-07-09 16:41:49 +00:00
parent c263e61639
commit 1a465c2305
1 changed files with 8 additions and 4 deletions

View File

@ -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;