Fix two memory leaks in chan_gtalk, thanks Eliel!
authorPhilippe Sultan <philippe.sultan@gmail.com>
Thu, 21 Aug 2008 09:55:31 +0000 (09:55 +0000)
committerPhilippe Sultan <philippe.sultan@gmail.com>
Thu, 21 Aug 2008 09:55:31 +0000 (09:55 +0000)
(closes issue #13310)
Reported by: eliel
Patches:
      chan_gtalk.c.patch uploaded by eliel (license 64)

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

channels/chan_gtalk.c

index d42afaf..76b4f9a 100644 (file)
@@ -1619,6 +1619,7 @@ static struct ast_channel *gtalk_request(const char *type, int format, void *dat
                client->connection = ast_aji_get_client(sender);
                if (!client->connection) {
                        ast_log(LOG_ERROR, "No XMPP client to talk to, us (partial JID) : %s\n", sender);
+                       ASTOBJ_UNREF(client, gtalk_member_destroy);
                        return NULL;
                }
        }
@@ -1960,6 +1961,7 @@ static int gtalk_load_config(void)
                                                ASTOBJ_UNLOCK(iterator);
                                        });
                                        ASTOBJ_CONTAINER_LINK(&gtalk_list, member);
+                                       ASTOBJ_UNREF(member, gtalk_member_destroy);
                                } else {
                                        ASTOBJ_UNLOCK(member);
                                        ASTOBJ_UNREF(member, gtalk_member_destroy);