]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 16 Feb 2007 19:43:00 +0000 (19:43 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 16 Feb 2007 19:43:00 +0000 (19:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4298 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index d1e79babbd8e9016c9268e37c72cc0a3563432f7..8f11645a8d8951af5fe51b86e7fec82e02d26e6f 100644 (file)
@@ -803,7 +803,7 @@ static void tech_set_codecs(private_object_t *tech_pvt)
     } else {
         if (!(codec_string = switch_channel_get_variable(channel, "codec_string"))) {
                        if (tech_pvt->profile->codec_string) {
-                               codec_string = switch_core_session_strdup(tech_pvt->session, tech_pvt->profile->codec_string);
+                               codec_string = tech_pvt->profile->codec_string;
                        }
         }
         
@@ -821,12 +821,15 @@ static void tech_set_codecs(private_object_t *tech_pvt)
     }
 
        if (codec_string) {
-        tech_pvt->profile->codec_order_last = switch_separate_string(codec_string, ',', tech_pvt->profile->codec_order, SWITCH_MAX_CODECS);
-               tech_pvt->num_codecs = switch_loadable_module_get_codecs_sorted(tech_pvt->codecs,
-                                                                                                                                               SWITCH_MAX_CODECS,
-                                                                                                                                               tech_pvt->profile->codec_order,
-                                                                                                                                               tech_pvt->profile->codec_order_last);
-               
+               char *tmp_codec_string;
+               if ((tmp_codec_string = strdup(codec_string))) {
+                       tech_pvt->profile->codec_order_last = switch_separate_string(tmp_codec_string, ',', tech_pvt->profile->codec_order, SWITCH_MAX_CODECS);
+                       tech_pvt->num_codecs = switch_loadable_module_get_codecs_sorted(tech_pvt->codecs,
+                                                                                                                                                       SWITCH_MAX_CODECS,
+                                                                                                                                                       tech_pvt->profile->codec_order,
+                                                                                                                                                       tech_pvt->profile->codec_order_last);
+                       free(tmp_codec_string);
+               }
        } else {
                tech_pvt->num_codecs = switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), tech_pvt->codecs,
                                                                                                                                 sizeof(tech_pvt->codecs) / sizeof(tech_pvt->codecs[0]));