mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 09:06:21 +00:00
Free split args in command.c
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user