mirror of
https://github.com/profanity-im/profanity.git
synced 2024-08-18 19:04:14 -04:00
fixed memory leak in parse_room_jid
This commit is contained in:
parent
3a22719bd7
commit
76270fdca8
15
src/jid.c
15
src/jid.c
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user