[Asterisk-code-review] res pjsip: Fix leak of persistent endpoint references. (asterisk[13])

Corey Farrell asteriskteam at digium.com
Thu Oct 5 16:31:42 CDT 2017


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/6660


Change subject: res_pjsip: Fix leak of persistent endpoint references.
......................................................................

res_pjsip: Fix leak of persistent endpoint references.

sip_endpoint_apply_handler may be called multiple times on the same
endpoint, this added extra references to endpoint->persistent.

ASTERISK-27306

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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/60/6660/1

diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 88ffadb..311f48c 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -1328,8 +1328,11 @@
 {
 	struct ast_sip_endpoint *endpoint = obj;
 
-	if (!(endpoint->persistent = persistent_endpoint_find_or_create(endpoint))) {
-		return -1;
+	if (!endpoint->persistent) {
+		endpoint->persistent = persistent_endpoint_find_or_create(endpoint);
+		if (!endpoint->persistent) {
+			return -1;
+		}
 	}
 
 	if (endpoint->extensions.timer.min_se < 90) {

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59bbfc8da8a14d5f4af8c5bb1e71f8592ae823eb
Gerrit-Change-Number: 6660
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171005/ec51d87e/attachment.html>


More information about the asterisk-code-review mailing list