res_pjsip_session: Fix off-nominal extra unref of session.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 18 Mar 2015 02:42:16 +0000 (02:42 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 18 Mar 2015 02:42:16 +0000 (02:42 +0000)
........

Merged revisions 433088 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433089 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_pjsip_session.c

index 5b75f3c..865483a 100644 (file)
@@ -1869,7 +1869,7 @@ static void handle_new_invite_request(pjsip_rx_data *rdata)
                        ast_pjsip_rdata_get_endpoint(rdata), ao2_cleanup);
        pjsip_tx_data *tdata = NULL;
        pjsip_inv_session *inv_session = NULL;
-       RAII_VAR(struct ast_sip_session *, session, NULL, ao2_cleanup);
+       struct ast_sip_session *session;
        struct new_invite *invite;
 
        ast_assert(endpoint != NULL);
@@ -1897,10 +1897,9 @@ static void handle_new_invite_request(pjsip_rx_data *rdata)
                } else {
                        pjsip_inv_send_msg(inv_session, tdata);
                }
-               ao2_ref(session, -1);
                ao2_cleanup(invite);
-               return;
        }
+       ao2_ref(session, -1);
 }
 
 static pj_bool_t does_method_match(const pj_str_t *message_method, const char *supplement_method)