1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Merge pull request #134 from pasis/fixes

fixed memory leak in parse_room_jid
This commit is contained in:
James Booth 2013-01-12 17:19:34 -08:00
commit 0827ac344f

View File

@ -121,18 +121,21 @@ jid_create_room_jid(const char * const room, const char * const nick)
gboolean
parse_room_jid(const char * const full_room_jid, char **room, char **nick)
{
gboolean result = FALSE;
char **tokens = g_strsplit(full_room_jid, "/", 0);
if (tokens == NULL || tokens[0] == NULL || tokens[1] == NULL) {
if (tokens == NULL)
return FALSE;
} else {
if (tokens[0] != NULL && tokens[1] != NULL) {
*room = strdup(tokens[0]);
*nick = strdup(tokens[1]);
g_strfreev(tokens);
return TRUE;
result = TRUE;
}
g_strfreev(tokens);
return result;
}
/*