Merged revisions 81433 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Mon, 3 Sep 2007 18:59:08 +0000 (18:59 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 3 Sep 2007 18:59:08 +0000 (18:59 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81433 | russell | 2007-09-03 13:57:53 -0500 (Mon, 03 Sep 2007) | 5 lines

Remove a couple of calls to ast_string_field_free_pools() on peers in error
handling blocks in the code for building peers.  The peer object destructor
does this and doing it twice will cause a crash.
(closes issue #10625, reported by and patched by pnlarsson)

........

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

channels/chan_iax2.c

index bc6f686..7644615 100644 (file)
@@ -9517,20 +9517,16 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
                                                ast_sched_del(sched, peer->expire);
                                        peer->expire = -1;
                                        ast_clear_flag(peer, IAX_DYNAMIC);
-                                       if (ast_dnsmgr_lookup(v->value, &peer->addr.sin_addr, &peer->dnsmgr)) {
-                                               ast_string_field_free_pools(peer);
+                                       if (ast_dnsmgr_lookup(v->value, &peer->addr.sin_addr, &peer->dnsmgr))
                                                return peer_unref(peer);
-                                       }
                                        if (!peer->addr.sin_port)
                                                peer->addr.sin_port = htons(IAX_DEFAULT_PORTNO);
                                }
                                if (!maskfound)
                                        inet_aton("255.255.255.255", &peer->mask);
                        } else if (!strcasecmp(v->name, "defaultip")) {
-                               if (ast_get_ip(&peer->defaddr, v->value)) {
-                                       ast_string_field_free_pools(peer);
+                               if (ast_get_ip(&peer->defaddr, v->value))
                                        return peer_unref(peer);
-                               }
                        } else if (!strcasecmp(v->name, "sourceaddress")) {
                                peer_set_srcaddr(peer, v->value);
                        } else if (!strcasecmp(v->name, "permit") ||