Skip to content

Commit

Permalink
gbagfx: Check for nullptr for new output path
Browse files Browse the repository at this point in the history
  • Loading branch information
Sierraffinity committed Apr 22, 2020
1 parent 8c1d0d7 commit 060e973
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/gbagfx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,10 @@ int main(int argc, char **argv)
FATAL_ERROR("Output file \"%s\" has no extension.\n", outputPath);

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++)
{
Expand Down

0 comments on commit 060e973

Please sign in to comment.