From ef49afdc63256d31319faba33e75fb378daf9da8 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Sun, 13 Jan 2013 00:08:31 +0200 Subject: fixed resources release * Use free instead of g_free as resources are allocated with strdup * Fixed memory leaks --- src/jabber.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/jabber.c b/src/jabber.c index a062ca27..85c06f0d 100644 --- a/src/jabber.c +++ b/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; } -- cgit 1.4.1-2-gfad0