summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c3
1 files changed, 2 insertions, 1 deletions
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);
}