From b4c6831b563e1744f0b826a3b65669c9dc0e1270 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Tue, 22 Mar 2016 00:01:25 +0100 Subject: [PATCH] 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. --- frontend/drivers/platform_linux.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/frontend/drivers/platform_linux.c b/frontend/drivers/platform_linux.c index 41ba2e7ab3..971f114a14 100644 --- a/frontend/drivers/platform_linux.c +++ b/frontend/drivers/platform_linux.c @@ -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");