DummyFileSize = ftell (DummyFile);\r
fseek (DummyFile, 0, SEEK_SET);\r
DummyFileBuffer = (UINT8 *) malloc (DummyFileSize);\r
+ if (DummyFileBuffer == NULL) {\r
+ fclose(DummyFile);\r
+ Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");\r
+ goto Finish;\r
+ }\r
+\r
fread(DummyFileBuffer, 1, DummyFileSize, DummyFile);\r
fclose(DummyFile);\r
DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %s and the size is %u bytes", DummyFileName, (unsigned) DummyFileSize);\r
\r
+ if (InputFileName == NULL) {\r
+ Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");\r
+ goto Finish;\r
+ }\r
InFile = fopen(LongFilePath(InputFileName[0]), "rb");\r
if (InFile == NULL) {\r
Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);\r
InFileSize = ftell (InFile);\r
fseek (InFile, 0, SEEK_SET);\r
InFileBuffer = (UINT8 *) malloc (InFileSize);\r
+ if (InFileBuffer == NULL) {\r
+ fclose(InFile);\r
+ Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");\r
+ goto Finish;\r
+ }\r
+\r
fread(InFileBuffer, 1, InFileSize, InFile);\r
fclose(InFile);\r
DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[0], (unsigned) InFileSize);\r