[Asterisk-code-review] res pjsip: Fix leak of persistent endpoint references. (asterisk[master])
    Corey Farrell 
    asteriskteam at digium.com
       
    Thu Oct  5 16:30:53 CDT 2017
    
    
  
Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/6657
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/57/6657/1
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 3a752c9..3a3df0e 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -1326,8 +1326,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/6657
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59bbfc8da8a14d5f4af8c5bb1e71f8592ae823eb
Gerrit-Change-Number: 6657
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/245a8910/attachment.html>
    
    
More information about the asterisk-code-review
mailing list