Fix memory leaks, reported by Huihui Huang in GitHub issue 4872.

This commit is contained in:
nicm
2026-02-23 08:45:27 +00:00
parent 23ad10c849
commit 3094ca1da5
2 changed files with 27 additions and 20 deletions

View File

@@ -57,6 +57,9 @@ environ_free(struct environ *env)
{
struct environ_entry *envent, *envent1;
if (env == NULL)
return;
RB_FOREACH_SAFE(envent, environ, env, envent1) {
RB_REMOVE(environ, env, envent);
free(envent->name);