This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 3581668  env_dup: Allocate memory from the correct memory pool
3581668 is described below

commit 3581668c6bbddd3964b5514a48a129bacd0c2dad
Author: Ville Juven <[email protected]>
AuthorDate: Mon Mar 21 16:21:15 2022 +0200

    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
---
 sched/environ/env_dup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sched/environ/env_dup.c b/sched/environ/env_dup.c
index a337e62..0a7bbeb 100644
--- a/sched/environ/env_dup.c
+++ b/sched/environ/env_dup.c
@@ -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

Reply via email to