diff options
-rw-r--r-- | res/res_jabber.c | 4 |
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; } |