No need to copy that argument.

The copy also lacked the NUL terminator, wouldn't surprise me if it crashed. Let's just clean it up.
This commit is contained in:
Alcaro 2016-03-22 00:01:25 +01:00
parent 43c8fc50be
commit b4c6831b56

View File

@ -2187,12 +2187,7 @@ static bool frontend_linux_set_fork(enum frontend_fork fork_mode)
static void frontend_linux_exec(const char *path, bool should_load_game)
{
char *newargv[] = { NULL, NULL };
size_t len = strlen(path);
newargv[0] = malloc(len);
strlcpy(newargv[0], path, len);
const char *newargv[] = { path, NULL };
execv(path, newargv);
perror("execv");