about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-03-25 16:50:10 +0100
committerMichael Vetter <jubalh@iodoru.org>2021-03-25 16:50:10 +0100
commit8df5e9998166497104eedd664078c277a94bc8e2 (patch)
tree350da42d3ad884f03e16fd68653d3293c8f51b93
parent3a6bce5a099fff74f1a2b0bc84f38ef88bc84fef (diff)
downloadprofani-tty-8df5e9998166497104eedd664078c277a94bc8e2.tar.gz
message: make _handle_error safer
-rw-r--r--src/xmpp/message.c6
1 files 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);
     }