env_dup: Allocate memory from the correct memory pool

When the initial proxy task is duplicated into the first user task,
the environment exists in kernel memory and this must be copied to user
memory.

The memory allocated for the new task was allocated with the parent's
priority which is incorrect. Use the new task's priority instead.

Follow-up for: #5753
This commit is contained in:
Ville Juven 2022-03-21 16:21:15 +02:00 committed by Xiang Xiao
parent 9a9a06dd7d
commit 3581668c6b

View File

@ -94,7 +94,7 @@ int env_dup(FAR struct task_group_s *group)
{
/* There is an environment, duplicate it */
envp = (FAR char *)group_malloc(ptcb->group, envlen);
envp = (FAR char *)group_malloc(group, envlen);
if (envp == NULL)
{
/* The parent's environment can not be inherited due to a