about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-07-19 12:38:33 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-07-19 12:38:33 +0200
commitd3828cf24e0c867c62c84ee2a69d8c132776368a (patch)
treec26bcc733f48bbc7cdbaaa5c0b0273a3955f7dfe /src
parent1bb05569b6860cd19f3746bd747faf54dcfb5860 (diff)
downloadprofani-tty-d3828cf24e0c867c62c84ee2a69d8c132776368a.tar.gz
Fix segfault in block command
Another case of double free() due to new destructor.

Fixes https://github.com/profanity-im/profanity/issues/1156
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/blocking.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/xmpp/blocking.c b/src/xmpp/blocking.c
index d3c84f0d..5784122e 100644
--- a/src/xmpp/blocking.c
+++ b/src/xmpp/blocking.c
@@ -235,18 +235,15 @@ _block_add_result_handler(xmpp_stanza_t *const stanza, void *const userdata)
     const char *type = xmpp_stanza_get_type(stanza);
     if (!type) {
         log_info("Block response received for %s with no type attribute.", jid);
-        free(jid);
         return 0;
     }
 
     if (g_strcmp0(type, "result") != 0) {
         log_info("Block response received for %s with unrecognised type attribute.", jid);
-        free(jid);
         return 0;
     }
 
     cons_show("User %s successfully blocked.", jid);
-    free(jid);
 
     return 0;
 }
@@ -259,18 +256,15 @@ _block_remove_result_handler(xmpp_stanza_t *const stanza, void *const userdata)
     const char *type = xmpp_stanza_get_type(stanza);
     if (!type) {
         log_info("Unblock response received for %s with no type attribute.", jid);
-        free(jid);
         return 0;
     }
 
     if (g_strcmp0(type, "result") != 0) {
         log_info("Unblock response received for %s with unrecognised type attribute.", jid);
-        free(jid);
         return 0;
     }
 
     cons_show("User %s successfully unblocked.", jid);
-    free(jid);
 
     return 0;
 }