From e9dc1709d61e89a6208680775c9345a69609ee1b Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Tue, 11 Oct 2011 07:26:16 +0000 Subject: Fixed #1386: fixed send_raw_resolver_callback() in sip_util.c, should increment tdata ref count before calling pjsip_tpmgr_send_raw() to avoid tdata gets destroyed prematurely. git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3813 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip/sip_util.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pjsip/src') diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c index bdf8fe6a..f5d360c3 100644 --- a/pjsip/src/pjsip/sip_util.c +++ b/pjsip/src/pjsip/sip_util.c @@ -1390,6 +1390,9 @@ static void send_raw_resolver_callback( pj_status_t status, pj_assert(addr->count != 0); + /* Avoid tdata destroyed by pjsip_tpmgr_send_raw(). */ + pjsip_tx_data_add_ref(sraw_data->tdata); + data_len = sraw_data->tdata->buf.cur - sraw_data->tdata->buf.start; status = pjsip_tpmgr_send_raw(pjsip_endpt_get_tpmgr(sraw_data->endpt), addr->entry[0].type, -- cgit v1.2.3