]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't free reason string passed to nua_respond before we are done using it. (nh scope...
authorMichael Jerris <mike@jerris.com>
Fri, 30 May 2008 20:29:32 +0000 (20:29 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 30 May 2008 20:29:32 +0000 (20:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8731 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia_reg.c

index a08896a2f615da97dc2bd8a5719a3d488085379f..34693529e77bff97baff4bb865bbcd324d536783 100644 (file)
@@ -988,7 +988,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                }
 
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Overlap Dial with %d %s\n", code, reason);
-                               nua_respond(tech_pvt->nh, code, reason, TAG_IF(to_uri, SIPTAG_CONTACT_STR(to_uri)),
+                               nua_respond(tech_pvt->nh, code, su_strdup(tech_pvt->nh->nh_home, reason), TAG_IF(to_uri, SIPTAG_CONTACT_STR(to_uri)),
                                                        SIPTAG_SUPPORTED_STR(NULL), SIPTAG_ACCEPT_STR(NULL),
                                                        TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
                                if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
@@ -1003,12 +1003,12 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                                sofia_glue_tech_patch_sdp(tech_pvt);
                                                sofia_glue_tech_proxy_remote_addr(tech_pvt);
                                        }
-                                       nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
+                                       nua_respond(tech_pvt->nh, code, su_strdup(tech_pvt->nh->nh_home, reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
                                                                SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
                                                                SOATAG_REUSE_REJECTED(1),
                                                                SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
                                } else {
-                                       nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END());
+                                       nua_respond(tech_pvt->nh, code, su_strdup(tech_pvt->nh->nh_home, reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END());
                                }
                                if (!switch_channel_test_flag(channel, CF_ANSWERED) && code >= 300) {
                                        switch_set_flag_locked(tech_pvt, TFLAG_BYE);
index 2f525bb4ba3a2146238bae84f7f544769af0aa10..bd0aa5fe076d640f13b44b54acfa231cfbfb9419 100644 (file)
@@ -91,6 +91,7 @@ typedef struct private_object private_object_t;
 #include <sofia-sip/su_log.h>
 #include <sofia-sip/nea.h>
 #include <sofia-sip/msg_addr.h>
+#include "nua_stack.h"
 
 typedef enum {
        DTMF_2833,
index d8c0506c8462640add0e8402af11cdd5384a73d0..0a706bd7c6f3e9c8853d7dbccf86bed653a26569 100644 (file)
@@ -35,7 +35,6 @@
  *
  */
 #include "mod_sofia.h"
-#include "nua_stack.h"
 
 static void sofia_reg_kill_reg(sofia_gateway_t *gateway_ptr, int unreg)
 {