]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
plug leak (FSCORE-164)
authorMichael Jerris <mike@jerris.com>
Mon, 28 Jul 2008 15:38:52 +0000 (15:38 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 28 Jul 2008 15:38:52 +0000 (15:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9182 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_session.c

index a8aa6c1e734cc57c6809cae8f6eb0da687eb80b2..3b8ecfd16339894b547a3e5ee5b1c49401406433 100644 (file)
@@ -1033,7 +1033,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application(switch_c
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Application %s Requires media on channel %s!\n",
                                                  app, switch_channel_get_name(session->channel));
        } else if (!switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA) && !switch_channel_media_ready(session->channel)) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Application %s Requires media! pre_answering channel %s\n",
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Application %s Requires media! pre_anyswering channel %s\n",
                                                  app, switch_channel_get_name(session->channel));
                if (switch_channel_pre_answer(session->channel) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Well, that didn't work very well did it? ...\n");
@@ -1048,7 +1048,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application(switch_c
        if (switch_channel_get_variable(session->channel, "presence_id")) {
                char *myarg = NULL;
                if (expanded) {
-                       switch_mprintf("%s(%s)", app, expanded);
+                       myarg = switch_mprintf("%s(%s)", app, expanded);
+               } else if (!switch_strlen_zero(arg)) {
+                       myarg = switch_mprintf("%s(%s)", app, arg);
+               } else {
+                       myarg = switch_mprintf("%s", app);
                }
                if (myarg) {
                        switch_channel_presence(session->channel, "unknown", myarg);