gbagfx: Check for nullptr for new output path

This commit is contained in:
Sierraffinity 2020-04-22 16:53:11 -07:00
parent 21e9ed6615
commit b2d8c6793d
1 changed files with 4 additions and 1 deletions

View File

@ -552,7 +552,10 @@ int main(int argc, char **argv)
FATAL_ERROR("Output file \"%s\" has no extension.\n", outputPath); FATAL_ERROR("Output file \"%s\" has no extension.\n", outputPath);
size_t newOutputPathSize = strlen(inputPath) - strlen(inputFileExtension) + strlen(outputFileExtension); size_t newOutputPathSize = strlen(inputPath) - strlen(inputFileExtension) + strlen(outputFileExtension);
outputPath = (char *)malloc(newOutputPathSize); outputPath = malloc(newOutputPathSize);
if (outputPath == NULL)
FATAL_ERROR("Failed to allocate memory for new output path.\n");
for (int i = 0; i < newOutputPathSize; i++) for (int i = 0; i < newOutputPathSize; i++)
{ {