[Asterisk-code-review] pjsip distributor.c: Fix off-nominal tdata ref leak. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Sun Feb 12 15:31:19 CST 2017


Richard Mudgett has uploaded a new change for review. ( https://gerrit.asterisk.org/4924 )

Change subject: pjsip_distributor.c: Fix off-nominal tdata ref leak.
......................................................................

pjsip_distributor.c: Fix off-nominal tdata ref leak.

Change-Id: I571f371d0956a8039b197b4dbd8af6b18843598d
---
M res/res_pjsip/pjsip_distributor.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/4924/1

diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c
index 7900611..82ca184 100644
--- a/res/res_pjsip/pjsip_distributor.c
+++ b/res/res_pjsip/pjsip_distributor.c
@@ -729,8 +729,7 @@
 				ao2_ref(unid, -1);
 			}
 			ast_sip_report_auth_success(endpoint, rdata);
-			pjsip_tx_data_dec_ref(tdata);
-			return PJ_FALSE;
+			break;
 		case AST_SIP_AUTHENTICATION_FAILED:
 			log_failed_request(rdata, "Failed to authenticate", 0, 0);
 			ast_sip_report_auth_failed_challenge_response(endpoint, rdata);
@@ -743,6 +742,7 @@
 			pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 500, NULL, NULL, NULL);
 			return PJ_TRUE;
 		}
+		pjsip_tx_data_dec_ref(tdata);
 	}
 
 	return PJ_FALSE;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I571f371d0956a8039b197b4dbd8af6b18843598d
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list