summaryrefslogtreecommitdiff
path: root/tools/gbagfx/main.c
diff options
context:
space:
mode:
authorSierra A <6080951+Sierraffinity@users.noreply.github.com>2020-04-22 17:23:36 -0700
committerGitHub <noreply@github.com>2020-04-22 17:23:36 -0700
commitdc126e30169bd145d28c6d84e4bb466d96394d29 (patch)
treef023fddc72bed9ba3fde080b8be06ec341a55ed0 /tools/gbagfx/main.c
parentdbe48cfb08233052883096c17992a9c360f1d478 (diff)
parentb2d8c6793d80709525d1061c3df6f8f54ee130e1 (diff)
Merge pull request #1026 from Sierraffinity/master
gbagfx: Check for nullptr for new output path
Diffstat (limited to 'tools/gbagfx/main.c')
-rw-r--r--tools/gbagfx/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/gbagfx/main.c b/tools/gbagfx/main.c
index b02f4d9f5..9fd72383d 100644
--- a/tools/gbagfx/main.c
+++ b/tools/gbagfx/main.c
@@ -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++)
{