This change fixes two issues reported by the clang analyzer. In both cases, uninitialized
variable value was used in an error code path.
Commit migrated from https://github.com/dotnet/coreclr/commit/
3011ab330532cbd6f82da9b8ae5d1d28c324cc06
PathCharString dirNameBufferPathString;
size_t length;
char * dirNameBuffer;
+ const char * dirName;
int size;
PERF_ENTRY(GetDiskFreeSpaceW);
if ( size != 0 )
{
FILEDosToUnixPathA( dirNameBuffer );
- statfsRetVal = statfs( dirNameBuffer, &fsInfoBuffer );
+ dirName = dirNameBuffer;
}
else
{
}
else
{
- statfsRetVal = statfs( "/", &fsInfoBuffer );
+ dirName = "/";
}
+ statfsRetVal = statfs( dirName, &fsInfoBuffer );
+
if ( statfsRetVal == 0 )
{
*lpBytesPerSector = fsInfoBuffer.f_bsize;
&dwFileSizeHigh
);
- lpFileSize->u.LowPart = dwFileSizeLow;
- lpFileSize->u.HighPart = dwFileSizeHigh;
+ if (NO_ERROR == palError)
+ {
+ lpFileSize->u.LowPart = dwFileSizeLow;
+ lpFileSize->u.HighPart = dwFileSizeHigh;
+ }
}
else
{