From c34247d0b3111f16dae1a52d831df0d61c03ee35 Mon Sep 17 00:00:00 2001 From: dequis Date: Mon, 23 Nov 2015 14:38:11 -0300 Subject: 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. --- protocols/jabber/conference.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'protocols') 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; -- cgit v1.2.3