summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/include/pjsip/sip_transaction.h9
-rw-r--r--pjsip/src/pjsip/sip_transaction.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/pjsip/include/pjsip/sip_transaction.h b/pjsip/include/pjsip/sip_transaction.h
index 4a7305ec..065b71c2 100644
--- a/pjsip/include/pjsip/sip_transaction.h
+++ b/pjsip/include/pjsip/sip_transaction.h
@@ -190,11 +190,12 @@ PJ_DECL(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user,
/**
* Transmit message in tdata with this transaction. It is possible to
- * pass NULL in tdata for UAC transaction, which in this case the last message
- * or the request message which was specified in #pjsip_tsx_create_uac()
- * will be sent.
+ * pass NULL in tdata for UAC transaction, which in this case the last
+ * message transmitted, or the request message which was specified when
+ * calling #pjsip_tsx_create_uac(), will be sent.
*
- * This function decrements the reference counter of the transmit buffer.
+ * This function decrements the reference counter of the transmit buffer
+ * only when it returns PJ_SUCCESS;
*
* @param tsx The transaction.
* @param tdata The outgoing message. If NULL is specified, then the
diff --git a/pjsip/src/pjsip/sip_transaction.c b/pjsip/src/pjsip/sip_transaction.c
index d9824562..dd6c7641 100644
--- a/pjsip/src/pjsip/sip_transaction.c
+++ b/pjsip/src/pjsip/sip_transaction.c
@@ -1226,7 +1226,9 @@ PJ_DEF(pj_status_t) pjsip_tsx_send_msg( pjsip_transaction *tsx,
/* Will always decrement tdata reference counter
* (consistent with other send functions.
*/
- pjsip_tx_data_dec_ref(tdata);
+ if (status == PJ_SUCCESS) {
+ pjsip_tx_data_dec_ref(tdata);
+ }
return status;
}