Skip to content

Commit

Permalink
Add g_strdup to argv elements in string_to_argv
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael9 committed Jun 20, 2014
1 parent 131ff38 commit a69354b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ char **string_to_argv(const char *s)

while (p) {
argv = realloc (argv, sizeof (char*) * ++n_spaces);
argv[n_spaces-1] = p;
argv[n_spaces-1] = g_strdup(p);
p = strtok (NULL, " ");
}
argv = realloc (argv, sizeof (char*) * (n_spaces+1));
Expand Down

0 comments on commit a69354b

Please sign in to comment.