mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
_handle_carbons(): fix potential memleak
This commit is contained in:
parent
813fd637a1
commit
5ec1b03cbc
@ -1114,8 +1114,6 @@ _handle_carbons(xmpp_stanza_t *const stanza)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
message->body = xmpp_message_get_body(message_stanza);
|
|
||||||
|
|
||||||
const gchar *to = xmpp_stanza_get_to(message_stanza);
|
const gchar *to = xmpp_stanza_get_to(message_stanza);
|
||||||
const gchar *from = xmpp_stanza_get_from(message_stanza);
|
const gchar *from = xmpp_stanza_get_from(message_stanza);
|
||||||
|
|
||||||
@ -1125,8 +1123,12 @@ _handle_carbons(xmpp_stanza_t *const stanza)
|
|||||||
Jid *jid_from = jid_create(from);
|
Jid *jid_from = jid_create(from);
|
||||||
Jid *jid_to = jid_create(to);
|
Jid *jid_to = jid_create(to);
|
||||||
|
|
||||||
|
message->body = xmpp_message_get_body(message_stanza);
|
||||||
|
|
||||||
if (!message->plain && !message->body) {
|
if (!message->plain && !message->body) {
|
||||||
log_error("Message received without body from: %s", jid_from->fulljid);
|
log_error("Message received without body from: %s", jid_from->fulljid);
|
||||||
|
jid_destroy(jid_from);
|
||||||
|
jid_destroy(jid_to);
|
||||||
goto out;
|
goto out;
|
||||||
} else if (!message->plain) {
|
} else if (!message->plain) {
|
||||||
message->plain = strdup(message->body);
|
message->plain = strdup(message->body);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user