]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
build_peer doesnt unlink a peer object from peers_by_ip container which leads to...
authorStefan Schmidt <sst@sil.at>
Mon, 12 Sep 2011 11:09:19 +0000 (11:09 +0000)
committerStefan Schmidt <sst@sil.at>
Mon, 12 Sep 2011 11:09:19 +0000 (11:09 +0000)
adding an ao2_unlink from the peers_by_ip container fix it.

Review: https://reviewboard.asterisk.org/r/1428/

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

channels/chan_sip.c

index 433f3f4291a36c0aaaee6add5e8770534dbc2837..92c8eaa12c46effefca7d7fe4ed472ea2b344389 100644 (file)
@@ -26562,6 +26562,9 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
        if (peer) {
                /* Already in the list, remove it and it will be added back (or FREE'd)  */
                found++;
+               /* we've unlinked the peer from the peers container but not unlinked from the peers_by_ip container yet
+                 this leads to a wrong refcounter and the peer object is never destroyed */
+               ao2_t_unlink(peers_by_ip, peer, "ao2_unlink peer from peers_by_ip table");
                if (!(peer->the_mark))
                        firstpass = 0;
        } else {