From 8df5e9998166497104eedd664078c277a94bc8e2 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 25 Mar 2021 16:50:10 +0100 Subject: [PATCH] message: make _handle_error safer --- src/xmpp/message.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xmpp/message.c b/src/xmpp/message.c index b1c22513..f638bd2e 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -864,8 +864,10 @@ _handle_error(xmpp_stanza_t* const stanza) } else { if (type && (strcmp(type, "cancel") == 0)) { Jid* jidp = jid_create(jid); - chat_session_remove(jidp->barejid); - jid_destroy(jidp); + if (jidp) { + chat_session_remove(jidp->barejid); + jid_destroy(jidp); + } } ui_handle_recipient_error(jid, err_msg); }