cwFileSys.cpp : Fixed failure to free expanded path on path not existing in isFile(),isDir(),isLink().

This commit is contained in:
kevin 2024-03-25 22:14:42 -04:00
parent 6b2a3db3f0
commit 43c5be958a

View File

@ -75,7 +75,7 @@ bool cw::filesys::isDir( const char* dir0 )
{ {
// if the dir does not exist // if the dir does not exist
if( errno == ENOENT ) if( errno == ENOENT )
return false; goto errLabel;
cwLogSysError( kOpFailRC, errno, "'stat' failed on '%s'",cwStringNullGuard(dir)); cwLogSysError( kOpFailRC, errno, "'stat' failed on '%s'",cwStringNullGuard(dir));
goto errLabel; goto errLabel;
@ -106,7 +106,7 @@ bool cw::filesys::isFile( const char* fn0 )
// if the file does not exist // if the file does not exist
if( errno == ENOENT ) if( errno == ENOENT )
return false; goto errLabel;
cwLogSysError( kOpFailRC, errno, "'stat' failed on '%s'.",cwStringNullGuard(fn)); cwLogSysError( kOpFailRC, errno, "'stat' failed on '%s'.",cwStringNullGuard(fn));
goto errLabel; goto errLabel;
@ -137,7 +137,7 @@ bool cw::filesys::isLink( const char* fn0 )
{ {
// if the file does not exist // if the file does not exist
if( errno == ENOENT ) if( errno == ENOENT )
return false; goto errLabel;
cwLogSysError( kOpFailRC, errno, "'stat' failed on '%s'.",cwStringNullGuard(fn)); cwLogSysError( kOpFailRC, errno, "'stat' failed on '%s'.",cwStringNullGuard(fn));
goto errLabel; goto errLabel;