diff options
author | tegge <tegge@FreeBSD.org> | 2001-11-07 23:00:05 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2001-11-07 23:00:05 +0000 |
commit | c98a8251e88b62d20cad387029037cc96eaf300a (patch) | |
tree | c1ab2a14d684b403c2c93665ce036bade87a869d /bin | |
parent | f1605e3295db00c5a9fc24dd1cffb82e788db0f1 (diff) | |
download | FreeBSD-src-c98a8251e88b62d20cad387029037cc96eaf300a.zip FreeBSD-src-c98a8251e88b62d20cad387029037cc96eaf300a.tar.gz |
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
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/cd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/sh/cd.c b/bin/sh/cd.c index 3ec8dee..bc2f718 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -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; } |