]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Delete unneeded check 06/4606/1
authorBadalyan Vyacheslav <v.badalyan@open-bs.ru>
Thu, 8 Dec 2016 18:54:06 +0000 (18:54 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 8 Dec 2016 22:55:41 +0000 (16:55 -0600)
P is always true. We check it before

Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb

channels/chan_sip.c

index 2f86bdf1754e107f2bed5fce6c2a6e22c46d2f50..8fa98d2c9e3fad5f5c8352ddabed13bca32d1fc0 100644 (file)
@@ -6892,10 +6892,9 @@ static int update_call_counter(struct sip_pvt *fup, int event)
                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;
 }