aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-11-23 14:38:11 -0300
committerdequis <dx@dxzone.com.ar>2015-11-23 14:38:11 -0300
commitc34247d0b3111f16dae1a52d831df0d61c03ee35 (patch)
tree63e24f85004960112c1d14d27b5c2f6d068f48c3
parent2f8e3cab9bcc724dfed40bfcd2434fc9a415398e (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.c5
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;