[Asterisk-code-review] chan sip: Delete unneeded check (asterisk[14])

Joshua Colp asteriskteam at digium.com
Thu Dec 8 16:55:42 CST 2016


Joshua Colp has uploaded a new change for review. ( https://gerrit.asterisk.org/4606 )

Change subject: chan_sip: Delete unneeded check
......................................................................

chan_sip: Delete unneeded check

P is always true. We check it before

Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb
---
M channels/chan_sip.c
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/06/4606/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2f86bdf..8fa98d2 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6892,10 +6892,9 @@
 		ast_log(LOG_ERROR, "update_call_counter(%s, %d) called with no event!\n", name, event);
 	}
 
-	if (p) {
-		ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "SIP/%s", p->name);
-		sip_unref_peer(p, "update_call_counter: sip_unref_peer from call counter");
-	}
+	ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "SIP/%s", p->name);
+	sip_unref_peer(p, "update_call_counter: sip_unref_peer from call counter");
+
 	return 0;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Badalian Vyacheslav <v.badalyan at open-bs.ru>



More information about the asterisk-code-review mailing list