From c98a8251e88b62d20cad387029037cc96eaf300a Mon Sep 17 00:00:00 2001 From: tegge Date: Wed, 7 Nov 2001 23:00:05 +0000 Subject: 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 --- bin/sh/cd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') 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; } -- cgit v1.1