Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh Plug a memory leak when setting PWD -- don't mark the...



details:   https://anonhg.NetBSD.org/src/rev/d7c16ebd8681
branches:  trunk
changeset: 517537:d7c16ebd8681
user:      he <he%NetBSD.org@localhost>
date:      Wed Nov 14 18:04:36 2001 +0000

description:
Plug a memory leak when setting PWD -- don't mark the variable with
VTEXTFIXED because the value is dynamically allocated.  Fix from
Tor Egge, FreeBSD PR#31533.

diffstat:

 bin/sh/cd.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r ad29888c309a -r d7c16ebd8681 bin/sh/cd.c
--- a/bin/sh/cd.c       Wed Nov 14 17:50:44 2001 +0000
+++ b/bin/sh/cd.c       Wed Nov 14 18:04:36 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd.c,v 1.27 1999/07/09 03:05:49 christos Exp $ */
+/*     $NetBSD: cd.c,v 1.28 2001/11/14 18:04:36 he Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)cd.c       8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: cd.c,v 1.27 1999/07/09 03:05:49 christos Exp $");
+__RCSID("$NetBSD: cd.c,v 1.28 2001/11/14 18:04:36 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -243,7 +243,7 @@
                prevdir = curdir;
                curdir = NULL;
                getpwd();
-               setvar("PWD", curdir, VEXPORT|VTEXTFIXED);
+               setvar("PWD", curdir, VEXPORT);
                INTON;
                return;
        }
@@ -274,7 +274,7 @@
                ckfree(prevdir);
        prevdir = curdir;
        curdir = savestr(stackblock());
-       setvar("PWD", curdir, VEXPORT|VTEXTFIXED);
+       setvar("PWD", curdir, VEXPORT);
        INTON;
 }
 



Home | Main Index | Thread Index | Old Index