res_pjsip: Fix transport ref leak.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 3 Apr 2017 18:56:43 +0000 (13:56 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 3 Apr 2017 19:03:24 +0000 (14:03 -0500)
We were leaking a transport ref in multihomed_on_rx_message() which
resulted in the FRACK about excessive ref counts.

ASTERISK-26916 #close

Change-Id: I7a96658a9614a060565bb9ad51cb1c9c11ee145f

res/res_pjsip/pjsip_message_ip_updater.c

index 864d898..2d07464 100644 (file)
@@ -339,8 +339,10 @@ static pj_bool_t multihomed_on_rx_message(pjsip_rx_data *rdata)
        transport = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "transport", transport_id);
 
        if (!(transport && transport->symmetric_transport)) {
+               ao2_cleanup(transport);
                return PJ_FALSE;
        }
+       ao2_cleanup(transport);
 
        x_transport = PJ_POOL_ALLOC_T(rdata->tp_info.pool, pjsip_param);
        x_transport->name = pj_strdup3(rdata->tp_info.pool, AST_SIP_X_AST_TXP);