1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-29 19:56:07 -04:00

Free split args in command.c

This commit is contained in:
James Booth 2012-04-27 01:14:17 +01:00
parent 0c0a242972
commit 161157a1c8

View File

@ -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;
}