mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Don't leak the individual strings when copying environment.
This commit is contained in:
parent
c38f0d85da
commit
adcc71d4d5
@ -168,8 +168,11 @@ environ_push(struct environ *env)
|
||||
var[strcspn(var, "=")] = '\0';
|
||||
ARRAY_ADD(&varlist, var);
|
||||
}
|
||||
for (i = 0; i < ARRAY_LENGTH(&varlist); i++)
|
||||
unsetenv(ARRAY_ITEM(&varlist, i));
|
||||
for (i = 0; i < ARRAY_LENGTH(&varlist); i++) {
|
||||
var = ARRAY_ITEM(&varlist, i);
|
||||
unsetenv(var);
|
||||
free(var);
|
||||
}
|
||||
ARRAY_FREE(&varlist);
|
||||
|
||||
RB_FOREACH(envent, environ, env) {
|
||||
|
Loading…
Reference in New Issue
Block a user