main: putenv() can't use stack mem as it might become part of env

and use later.

Avoid stack-use-after-scope.
This commit is contained in:
Boris Faure 2019-10-14 23:08:19 +02:00
parent 5e5ac579b5
commit e9b2d22ff7
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ main_ipc_new(Ipc_Instance *inst)
char buf[4096];
snprintf(buf, sizeof(buf), "DESKTOP_STARTUP_ID=%s", inst->startup_id);
putenv(buf);
putenv(strdup(buf));
}
ecore_app_args_get(&pargc, &pargv);
nargc = 1;