Merged revisions 202966 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Wed, 24 Jun 2009 18:29:10 +0000 (18:29 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 24 Jun 2009 18:29:10 +0000 (18:29 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r202966 | mmichelson | 2009-06-24 13:28:47 -0500 (Wed, 24 Jun 2009) | 3 lines

  Use the handy UNLINK macro instead of hand-coding the same thing in-line.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202967 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 5c15180..dbabdf9 100644 (file)
@@ -21142,11 +21142,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;
                        }