Only call free if it is necessary
This commit is contained in:
parent
65ddf77fbd
commit
4b525addb8
@ -1830,7 +1830,8 @@ static void setpwd(const char *val, int setold)
|
|||||||
getpwd();
|
getpwd();
|
||||||
else
|
else
|
||||||
curdir = simplify_path(val);
|
curdir = simplify_path(val);
|
||||||
free(cated);
|
if (cated)
|
||||||
|
free(cated);
|
||||||
INTON;
|
INTON;
|
||||||
setvar("PWD", curdir, VEXPORT);
|
setvar("PWD", curdir, VEXPORT);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user