about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-03-25 15:43:57 +0100
committerMichael Vetter <jubalh@iodoru.org>2021-03-25 15:43:57 +0100
commit1f96e14ce79d447369a5f14c2b62956d06aedf93 (patch)
tree4bcbaf6013d4d1e0f50b07634e62f40caa6413d1
parentb2a02424ed5eb61d9d904331f7fcfcb752c6e0fc (diff)
downloadprofani-tty-1f96e14ce79d447369a5f14c2b62956d06aedf93.tar.gz
message: simplify _handle_headline
-rw-r--r--src/xmpp/message.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index bb9d8038..b1c22513 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -116,14 +116,12 @@ _handled_by_plugin(xmpp_stanza_t* const stanza)
 static void
 _handle_headline(xmpp_stanza_t* const stanza)
 {
-    xmpp_ctx_t* ctx = connection_get_ctx();
-    char* text = NULL;
     xmpp_stanza_t* body = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_BODY);
     if (body) {
-        text = xmpp_stanza_get_text(body);
+        char *text = xmpp_stanza_get_text(body);
         if (text) {
             cons_show("Headline: %s", text);
-            xmpp_free(ctx, text);
+            xmpp_free(connection_get_ctx(), text);
         }
     }
 }