mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Don't call setvar() with the VTEXTFIXED flag. A copy is created by
setvar() and passed to setvareq(). When the VTEXTFIXED flag is set, that copy is never freed, causing a memory leak. PR: 31533 Submitted by: maxim@macomnet.ru
This commit is contained in:
parent
482a6000bb
commit
f14c1c47f9
1 changed files with 4 additions and 4 deletions
|
|
@ -238,8 +238,8 @@ updatepwd(dir)
|
|||
curdir = NULL;
|
||||
if (getpwd() == NULL)
|
||||
error("getcwd() failed: %s", strerror(errno));
|
||||
setvar("PWD", curdir, VEXPORT | VTEXTFIXED);
|
||||
setvar("OLDPWD", prevdir, VEXPORT | VTEXTFIXED);
|
||||
setvar("PWD", curdir, VEXPORT);
|
||||
setvar("OLDPWD", prevdir, VEXPORT);
|
||||
INTON;
|
||||
return;
|
||||
}
|
||||
|
|
@ -270,8 +270,8 @@ updatepwd(dir)
|
|||
ckfree(prevdir);
|
||||
prevdir = curdir;
|
||||
curdir = savestr(stackblock());
|
||||
setvar("PWD", curdir, VEXPORT | VTEXTFIXED);
|
||||
setvar("OLDPWD", prevdir, VEXPORT | VTEXTFIXED);
|
||||
setvar("PWD", curdir, VEXPORT);
|
||||
setvar("OLDPWD", prevdir, VEXPORT);
|
||||
INTON;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue