]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix segfaults
authorMichael Jerris <mike@jerris.com>
Wed, 29 Jul 2009 21:30:05 +0000 (21:30 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 29 Jul 2009 21:30:05 +0000 (21:30 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14422 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_lcr/mod_lcr.c

index 122b26c70adde78b3bef22e68de01b025953d775..c1220a9a32271ae9e5db31c52433ba7100dbfc0c 100644 (file)
@@ -671,11 +671,11 @@ static switch_status_t is_intrastatelata(callback_t *cb_struct)
                e164 format without the +
                NANP only (so 11 digits starting with 1)
        */
-       if (!cb_struct->lookup_number && strlen(cb_struct->lookup_number) != 11 && *cb_struct->lookup_number != '1') {
+       if (!cb_struct->lookup_number || strlen(cb_struct->lookup_number) != 11 && *cb_struct->lookup_number != '1') {
                /* dest doesn't appear to be NANP number */
                return SWITCH_STATUS_GENERR;
        }
-       if (!cb_struct->cid && strlen(cb_struct->cid) != 11 && *cb_struct->cid != '1') {
+       if (!cb_struct->cid || strlen(cb_struct->cid) != 11 && *cb_struct->cid != '1') {
                /* cid not NANP */
                return SWITCH_STATUS_GENERR;
        }
@@ -1278,7 +1278,7 @@ SWITCH_STANDARD_API(dialplan_lcr_function)
        lcr_route current = NULL;
        max_obj_t maximum_lengths = { 0 };
        callback_t cb_struct = { 0 };
-       switch_memory_pool_t *pool;
+       switch_memory_pool_t *pool = NULL;
        switch_event_t *event;
        switch_status_t lookup_status = SWITCH_STATUS_SUCCESS;
        switch_bool_t as_xml = SWITCH_FALSE;