1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -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:
Dmitry Podgorny 2013-01-13 00:08:31 +02:00
parent 59e4db0e96
commit ef49afdc63

View File

@ -575,8 +575,8 @@ _groupchat_message_handler(xmpp_stanza_t * const stanza)
// room not active in profanity // room not active in profanity
if (!muc_room_is_active(room_jid)) { if (!muc_room_is_active(room_jid)) {
log_error("Message recieved for inactive groupchat: %s", room_jid); log_error("Message recieved for inactive groupchat: %s", room_jid);
g_free(room); free(room);
g_free(nick); free(nick);
return 1; return 1;
} }
@ -596,6 +596,9 @@ _groupchat_message_handler(xmpp_stanza_t * const stanza)
} }
} }
free(room);
free(nick);
return 1; return 1;
} }
@ -704,7 +707,7 @@ _chat_message_handler(xmpp_stanza_t * const stanza)
} }
} }
g_free(jid); free(jid);
return 1; 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)) { if (!parse_room_jid(jid, &room, &nick)) {
log_error("Could not parse room jid: %s", room); log_error("Could not parse room jid: %s", room);
g_free(room);
g_free(nick);
return 1; return 1;
} }
@ -1021,6 +1021,9 @@ _room_presence_handler(const char * const jid, xmpp_stanza_t * const stanza)
} }
} }
free(room);
free(nick);
return 1; return 1;
} }