mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Free split args in command.c
This commit is contained in:
parent
0c0a242972
commit
161157a1c8
@ -81,8 +81,10 @@ static struct command_t _parse_command(char *str)
|
||||
struct command_t cmd;
|
||||
char **split = g_strsplit(str, " ", 0);
|
||||
|
||||
cmd.command = split[0];
|
||||
cmd.command = malloc((strlen(split[0]) + 1) * sizeof(char));
|
||||
strcpy(cmd.command, split[0]);
|
||||
cmd.params = NULL;
|
||||
g_strfreev(split);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user