Add g_strdup to argv elements in string_to_argv

This commit is contained in:
mickael9 2014-06-20 16:03:03 +02:00
parent 131ff38e65
commit a69354b1aa

View File

@ -77,7 +77,7 @@ char **string_to_argv(const char *s)
while (p) { while (p) {
argv = realloc (argv, sizeof (char*) * ++n_spaces); argv = realloc (argv, sizeof (char*) * ++n_spaces);
argv[n_spaces-1] = p; argv[n_spaces-1] = g_strdup(p);
p = strtok (NULL, " "); p = strtok (NULL, " ");
} }
argv = realloc (argv, sizeof (char*) * (n_spaces+1)); argv = realloc (argv, sizeof (char*) * (n_spaces+1));