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

Joshua Colp asteriskteam at digium.com
Fri Dec 9 05:31:47 CST 2016


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/4597 )

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(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 7f22b96..1566b54 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6885,10 +6885,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/4597
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Badalian Vyacheslav <v.badalyan at open-bs.ru>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list