]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix regression from f60fdf653dd2d7f8d3eaa6a9086e1f68bd993c59
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 4 Feb 2011 14:56:30 +0000 (08:56 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 4 Feb 2011 14:56:30 +0000 (08:56 -0600)
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c

index 0b16492e1498118db3040cdbf2bf29440a652a7c..f7bf86b4c73204325bd068d1b056ee2a511d82ea 100755 (executable)
@@ -2774,7 +2774,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
        switch_originate_flag_t myflags = SOF_NONE;
        char *cid_name_override = NULL;
        char *cid_num_override = NULL;
-       char *domain = NULL;
+       char *domain = NULL, *dup_domain = NULL;
        switch_channel_t *new_channel = NULL;
        unsigned int timelimit = 60;
        const char *skip, *var;
@@ -2788,6 +2788,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
                *domain++ = '\0';
        } else {
                domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));
+               dup_domain = domain;
        }
 
        if (!domain) {
@@ -2859,6 +2860,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
 
        switch_safe_free(template);
        switch_safe_free(group);
+       switch_safe_free(dup_domain);
 
        if (cause == SWITCH_CAUSE_NONE) {
                cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
index 43534dadbadc711b9c80c202b988001f5965c89d..3bc5cb4a3df6c0193988708584439074ec71b5eb 100644 (file)
@@ -309,11 +309,13 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
                                                                                                switch_call_cause_t *cancel_cause)
 {
        const char *profile;
+       char *dup_profile = NULL;
 
        if (session) {
                profile = switch_channel_get_variable(switch_core_session_get_channel(session), "sip_profile");
        } else {
-               profile = switch_core_get_variable_pdup("sip_profile", switch_core_session_get_pool(session));
+               dup_profile = switch_core_get_variable_dup("sip_profile");
+               profile = dup_profile;
        }
        if (zstr(profile)) {
                profile = "default";
@@ -323,6 +325,8 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
 
        UNPROTECT_INTERFACE(sip_endpoint_interface);
 
+       switch_safe_free(dup_profile);
+
        return switch_core_session_outgoing_channel(session, var_event, "sofia", outbound_profile, new_session, pool, SOF_NONE, cancel_cause);
 }