提交 9543656c 编写于 作者: A Alexander Monakov 提交者: Rich Felker

env: avoid leaving dangling pointers in __env_map

This is the minimal fix for __putenv leaving a pointer to freed heap
storage in __env_map array, which could later on lead to errors such
as double-free.
上级 589aefa5
......@@ -30,6 +30,7 @@ int __putenv(char *s, int a)
}
} else {
free(__env_map[j]);
__env_map[j] = s;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册