mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-25 19:55:54 +01:00
Check for NULL return from malloc in es vertification code and print error if es verification fails
This commit is contained in:
parent
9766df5f5b
commit
1a50ba665a
|
@ -252,6 +252,10 @@ ESStatus GetESStatus()
|
|||
return result;
|
||||
|
||||
char* temporaryBuffer = (char*)malloc(length);
|
||||
|
||||
if (!temporaryBuffer)
|
||||
return ESStatus::Error;
|
||||
|
||||
fseek(_fInput, 0, SEEK_SET);
|
||||
fread(temporaryBuffer, length, 1, _fInput);
|
||||
fseek(_fInput, 0, SEEK_SET);
|
||||
|
@ -398,6 +402,7 @@ int main(int argc, char *argv[])
|
|||
case ESStatus::Error:
|
||||
{
|
||||
fclose(_fInput);
|
||||
printf("Ecc encountered an error during the es verification.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user