]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use the handy UNLINK macro instead of hand-coding the same thing in-line.
authorMark Michelson <mmichelson@digium.com>
Wed, 24 Jun 2009 18:28:47 +0000 (18:28 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 24 Jun 2009 18:28:47 +0000 (18:28 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202966 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 9498b635297d33b50207d3abb5e25dfc15d5e0ae..1b97606d82af31c0d8f3c4eca7cc0e7f051166fe 100644 (file)
@@ -15530,11 +15530,7 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req)
                for (pkt = p->packets, prev_pkt = NULL; pkt; prev_pkt = pkt, pkt = pkt->next) {
                        if (pkt->seqno == p->lastinvite && pkt->response_code == 487) {
                                AST_SCHED_DEL(sched, pkt->retransid);
-                               if (prev_pkt) {
-                                       prev_pkt->next = pkt->next;
-                               } else {
-                                       p->packets = pkt->next;
-                               }
+                               UNLINK(pkt, p->packets, prev_pkt);
                                ast_free(pkt);
                                break;
                        }