diff options
author | dequis <dx@dxzone.com.ar> | 2015-11-23 14:38:11 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-11-23 14:38:11 -0300 |
commit | c34247d0b3111f16dae1a52d831df0d61c03ee35 (patch) | |
tree | 63e24f85004960112c1d14d27b5c2f6d068f48c3 | |
parent | 2f8e3cab9bcc724dfed40bfcd2434fc9a415398e (diff) |
jabber_chat_join_failed: add a null check before freeing the chat
Had this one in a stash, i think it's about trying to join a channel
with an invalid JID and getting an error with a different JID back, so
doing jabber_chat_by_jid() doesn't find it.
-rw-r--r-- | protocols/jabber/conference.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index ebb97a72..3de205c8 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -121,7 +121,10 @@ static xt_status jabber_chat_join_failed(struct im_connection *ic, struct xt_nod jabber_error_free(err); } if (bud) { - jabber_chat_free(jabber_chat_by_jid(ic, bud->bare_jid)); + struct groupchat *c = jabber_chat_by_jid(ic, bud->bare_jid); + if (c) { + jabber_chat_free(c); + } } return XT_HANDLED; |