]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10439: [mod_sofia] fix small leak when receiving REFER message
authorMike Jerris <mike@jerris.com>
Thu, 29 Jun 2017 18:21:07 +0000 (13:21 -0500)
committerMike Jerris <mike@jerris.com>
Thu, 29 Jun 2017 18:23:03 +0000 (13:23 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 2919a129df6fae580f18fad95ebb54a965f9be47..8750bc8568c74bee65c6e4574905dce67215b276 100644 (file)
@@ -8660,6 +8660,9 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                goto done;
        }
 
+       home = su_home_new(sizeof(*home));
+       switch_assert(home != NULL);
+
        if ((refer_to = sip->sip_refer_to)) {
                full_ref_to = sip_header_as_string(home, (void *) sip->sip_refer_to);
        }
@@ -8679,9 +8682,6 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
        from = sip->sip_from;
        //to = sip->sip_to;
 
-       home = su_home_new(sizeof(*home));
-       switch_assert(home != NULL);
-
        nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS_MSG(de->data->e_msg), SIPTAG_EXPIRES_STR("60"), TAG_END());