mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
out of memory checks: add missing sh_getcwd() wrapper (re: 7ad274f8)
getcwd() with 0/NULL arguments also mallocs, so needs a check.
This commit is contained in:
parent
f6a6d236f1
commit
a3f4b5efd1
3 changed files with 10 additions and 1 deletions
|
|
@ -262,7 +262,7 @@ char *path_pwd(Shell_t *shp,int flag)
|
|||
if(!(cp && *cp=='/' && test_inode(cp,e_dot)))
|
||||
{
|
||||
/* Get physical PWD (no symlinks) using getcwd(3), fall back to "." */
|
||||
cp = getcwd(NIL(char*),0);
|
||||
cp = sh_getcwd();
|
||||
if(!cp)
|
||||
return((char*)e_dot);
|
||||
tofree++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue