diff options
author | James Booth <boothj5@gmail.com> | 2012-04-27 01:14:17 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-04-27 01:14:17 +0100 |
commit | 161157a1c868746d052924bd590c5cfd9f7a75f7 (patch) | |
tree | 09d9f168fe932195dc6da089cf648758b49b238e /command.c | |
parent | 0c0a242972456e19a609b70cbbfc774cbfc1a91f (diff) | |
download | profani-tty-161157a1c868746d052924bd590c5cfd9f7a75f7.tar.gz |
Free split args in command.c
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/command.c b/command.c index de36e732..5ecb015e 100644 --- a/command.c +++ b/command.c @@ -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; } |