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/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 968e89303f env_dup: fix issue about USE_AFTER_FREE
968e89303f is described below
commit 968e89303f5403113b6ab6a4567257198b5b900b
Author: dongjiuzhu1 <[email protected]>
AuthorDate: Thu Oct 12 16:06:20 2023 +0800
env_dup: fix issue about USE_AFTER_FREE
Signed-off-by: dongjiuzhu1 <[email protected]>
---
sched/environ/env_dup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sched/environ/env_dup.c b/sched/environ/env_dup.c
index c588aa8376..3e3be281e8 100644
--- a/sched/environ/env_dup.c
+++ b/sched/environ/env_dup.c
@@ -125,6 +125,7 @@ int env_dup(FAR struct task_group_s *group, FAR char *
const *envcp)
}
group_free(group, envp);
+ envp = NULL;
ret = -ENOMEM;
break;
}