summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 01a02d3..828a888 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);
}