]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-382
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 15 Jun 2009 16:01:45 +0000 (16:01 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 15 Jun 2009 16:01:45 +0000 (16:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13774 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index ca7154cfdef4da9cb66fda9b4cde9b998cc43a47..3f3877b875b589da2828f50134b90860762a9290 100644 (file)
@@ -1395,10 +1395,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                        sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
                                }
                        } else if (code == 302 && !switch_strlen_zero(msg->string_arg)) {
-                               char * p = strchr(msg->string_arg, ' ');
-                               *p++ = '\0';
+                               char *p;
+
+                               if ((p = strchr(msg->string_arg, ' '))) {
+                                       *p = '\0';
+                                       msg->string_arg = p;
+                               }
+                               
                                msg->message_id = SWITCH_MESSAGE_INDICATE_REDIRECT;
-                               msg->string_arg = p;
                                switch_core_session_receive_message(session, msg);
                                goto end_lock;
                        } else {