Only call free if it is necessary

This commit is contained in:
Eric Andersen 2003-01-14 06:40:11 +00:00
parent 65ddf77fbd
commit 4b525addb8

View File

@ -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);
}