[Asterisk-code-review] pjproject: fixed tx data destroy called more than once (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Tue Jul 19 15:26:16 CDT 2016


Alexei Gradinari has uploaded a new change for review.

  https://gerrit.asterisk.org/3254

Change subject: pjproject: fixed tx_data_destroy called more than once
......................................................................

pjproject: fixed tx_data_destroy called more than once

This patch fixed the issue when tx_data_destroy can be called more than once.
The tx_data_destroy has to be called only once when ref_cnt is zero.

ASTERISK-26199 #close

Change-Id: I8b05917c93d993f95d604c042ace5f1a5500f59a
---
A third-party/pjproject/patches/0001-pjproject-pjsip_tx_data_dec_ref.patch
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/54/3254/1

diff --git a/third-party/pjproject/patches/0001-pjproject-pjsip_tx_data_dec_ref.patch b/third-party/pjproject/patches/0001-pjproject-pjsip_tx_data_dec_ref.patch
new file mode 100644
index 0000000..33b26e1
--- /dev/null
+++ b/third-party/pjproject/patches/0001-pjproject-pjsip_tx_data_dec_ref.patch
@@ -0,0 +1,13 @@
+Index: pjsip/src/pjsip/sip_transport.c
+===================================================================
+--- pjsip/src/pjsip/sip_transport.c	(revision 5389)
++++ pjsip/src/pjsip/sip_transport.c	(working copy)
+@@ -492,7 +492,7 @@
+ PJ_DEF(pj_status_t) pjsip_tx_data_dec_ref( pjsip_tx_data *tdata )
+ {
+     pj_assert( pj_atomic_get(tdata->ref_cnt) > 0);
+-    if (pj_atomic_dec_and_get(tdata->ref_cnt) <= 0) {
++    if (pj_atomic_dec_and_get(tdata->ref_cnt) == 0) {
+ 	tx_data_destroy(tdata);
+ 	return PJSIP_EBUFDESTROYED;
+     } else {

-- 
To view, visit https://gerrit.asterisk.org/3254
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b05917c93d993f95d604c042ace5f1a5500f59a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>



More information about the asterisk-code-review mailing list