Fix a couple of non-initialization bugs
authorMark Spencer <markster@digium.com>
Sat, 5 Apr 2003 22:33:42 +0000 (22:33 +0000)
committerMark Spencer <markster@digium.com>
Sat, 5 Apr 2003 22:33:42 +0000 (22:33 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@748 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 71f2ca6..80d103c 100755 (executable)
@@ -2562,6 +2562,7 @@ static void build_route(struct sip_pvt *p, struct sip_request *req, int backward
                                        /* If this was the first then it'll be the tail */
                                        if (!tail) tail = thishop;
                                } else {
+                                       thishop->next = NULL;
                                        /* Link in at the end */
                                        if (tail)
                                                tail->next = thishop;
@@ -2591,6 +2592,7 @@ static void build_route(struct sip_pvt *p, struct sip_request *req, int backward
                thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
                strncpy(thishop->hop, c, len);
                thishop->hop[len] = '\0';
+               thishop->next = NULL;
                /* Goes at the end */
                if (tail)
                        tail->next = thishop;