diff options
author | Dmitry Podgorny <pasis.ua@gmail.com> | 2013-01-13 00:08:31 +0200 |
---|---|---|
committer | Dmitry Podgorny <pasis.ua@gmail.com> | 2013-01-13 00:30:23 +0200 |
commit | ef49afdc63256d31319faba33e75fb378daf9da8 (patch) | |
tree | 8e4cf4fe97027b60ecc62974fee849b33478f750 /src | |
parent | 59e4db0e961ab6fa4bf1e3af8201b13c54357d8c (diff) | |
download | profani-tty-ef49afdc63256d31319faba33e75fb378daf9da8.tar.gz |
fixed resources release
* Use free instead of g_free as resources are allocated with strdup * Fixed memory leaks
Diffstat (limited to 'src')
-rw-r--r-- | src/jabber.c | 15 |
1 files changed, 9 insertions, 6 deletions
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; } |