From 4b525addb89d9e66b65e0a54ef7c15b677a74758 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 14 Jan 2003 06:40:11 +0000 Subject: Only call free if it is necessary --- shell/ash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 01a02d375..828a88872 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -1830,7 +1830,8 @@ static void setpwd(const char *val, int setold) getpwd(); else curdir = simplify_path(val); - free(cated); + if (cated) + free(cated); INTON; setvar("PWD", curdir, VEXPORT); } -- cgit v1.2.3