aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_jabber.c
diff options
context:
space:
mode:
authorphsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-29 14:47:10 +0000
committerphsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-29 14:47:10 +0000
commite546d5f67d70b2f37a9b7015a3d97130e5cd5905 (patch)
tree58975a3ea5c2ff632e6b892ec78437f635bf8ea0 /res/res_jabber.c
parent3cc2462e7b78135e24de46b06b814614df85b1f3 (diff)
Fix a potential memory leak
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105326 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r--res/res_jabber.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 37ef5a841..3f8329c95 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -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;
}