]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a potential memory leak
authorPhilippe Sultan <philippe.sultan@gmail.com>
Fri, 29 Feb 2008 14:47:10 +0000 (14:47 +0000)
committerPhilippe Sultan <philippe.sultan@gmail.com>
Fri, 29 Feb 2008 14:47:10 +0000 (14:47 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105326 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_jabber.c

index 37ef5a8414abf1443c38f2ba62d443c962b08b5c..3f8329c951b01e325fe52feff08ad28b8de1cbaf 100644 (file)
@@ -1455,6 +1455,7 @@ int ast_aji_create_chat(struct aji_client *client, char *room, char *server, cha
        int res = 0;
        iks *iq = NULL;
        iq = iks_new("iq");
+
        if (iq && client) {
                iks_insert_attrib(iq, "type", "get");
                iks_insert_attrib(iq, "to", server);
@@ -1463,6 +1464,9 @@ int ast_aji_create_chat(struct aji_client *client, char *room, char *server, cha
                iks_send(client->p, iq);
        } else 
                ast_log(LOG_ERROR, "Out of memory.\n");
+
+       iks_delete(iq);
+
        return res;
 }