]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't free the pool if it hasn't been created
authorRupa Schomaker <rupa@rupa.com>
Thu, 9 Jul 2009 16:41:49 +0000 (16:41 +0000)
committerRupa Schomaker <rupa@rupa.com>
Thu, 9 Jul 2009 16:41:49 +0000 (16:41 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14174 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_cidlookup/mod_cidlookup.c

index 0c2b54357a95c3efd051238165a19e6ce87b7f9d..72ed3be956779131b8ffa0a24ba3cef7a63bebf3 100755 (executable)
@@ -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;