diff --git a/sched/environ/env_dup.c b/sched/environ/env_dup.c index 6070cc462c5..9795666d078 100644 --- a/sched/environ/env_dup.c +++ b/sched/environ/env_dup.c @@ -63,7 +63,6 @@ int env_dup(FAR struct task_group_s *group, FAR char * const *envcp) { - FAR struct tcb_s *ptcb = this_task(); FAR char **envp = NULL; size_t envc = 0; int ret = OK; @@ -78,7 +77,7 @@ int env_dup(FAR struct task_group_s *group, FAR char * const *envcp) /* Is there an environment ? */ - if (envcp || (envcp = ptcb->group->tg_envp) != NULL) + if (envcp != NULL) { /* Count the strings */