mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
handle_headline(): Free text correctly
This commit is contained in:
parent
3640900cf6
commit
8d8ef675cd
@ -112,12 +112,14 @@ _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);
|
||||
if (text) {
|
||||
cons_show("Headline: %s", text);
|
||||
xmpp_free(ctx, text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user