Skip to content

Commit

Permalink
Ensure tdata ref count is decremented in all scenarios (#3739)
Browse files Browse the repository at this point in the history
Ensure tdata ref count is decremented in the unlikely case the cseq header is not valid.
  • Loading branch information
bogdan-mabo authored Oct 27, 2023
1 parent 5651d24 commit e4cfc9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pjsip/src/pjsip-ua/sip_inv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3805,9 +3805,9 @@ PJ_DEF(pj_status_t) pjsip_inv_send_msg( pjsip_inv_session *inv,
* request.
*/
cseq = (pjsip_cseq_hdr*)pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
PJ_ASSERT_RETURN(cseq != NULL
PJ_ASSERT_ON_FAIL(cseq != NULL
&& (inv->invite_tsx && cseq->cseq == inv->invite_tsx->cseq),
PJ_EINVALIDOP);
{ pjsip_tx_data_dec_ref(tdata); return PJ_EINVALIDOP; });

if (inv->options & PJSIP_INV_REQUIRE_100REL) {
status = pjsip_100rel_tx_response(inv, tdata);
Expand Down

0 comments on commit e4cfc9b

Please sign in to comment.