mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
fixed resources release
* Use free instead of g_free as resources are allocated with strdup * Fixed memory leaks
This commit is contained in:
parent
59e4db0e96
commit
ef49afdc63
15
src/jabber.c
15
src/jabber.c
@ -575,8 +575,8 @@ _groupchat_message_handler(xmpp_stanza_t * const stanza)
|
||||
// room not active in profanity
|
||||
if (!muc_room_is_active(room_jid)) {
|
||||
log_error("Message recieved for inactive groupchat: %s", room_jid);
|
||||
g_free(room);
|
||||
g_free(nick);
|
||||
free(room);
|
||||
free(nick);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -596,6 +596,9 @@ _groupchat_message_handler(xmpp_stanza_t * const stanza)
|
||||
}
|
||||
}
|
||||
|
||||
free(room);
|
||||
free(nick);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -704,7 +707,7 @@ _chat_message_handler(xmpp_stanza_t * const stanza)
|
||||
}
|
||||
}
|
||||
|
||||
g_free(jid);
|
||||
free(jid);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -943,9 +946,6 @@ _room_presence_handler(const char * const jid, xmpp_stanza_t * const stanza)
|
||||
|
||||
if (!parse_room_jid(jid, &room, &nick)) {
|
||||
log_error("Could not parse room jid: %s", room);
|
||||
g_free(room);
|
||||
g_free(nick);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1021,6 +1021,9 @@ _room_presence_handler(const char * const jid, xmpp_stanza_t * const stanza)
|
||||
}
|
||||
}
|
||||
|
||||
free(room);
|
||||
free(nick);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user