Don't free ctx->mainfn if context build fails; it wasn't ever set.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 29 May 2016 02:59:29 -0400
changeset 1175 9a010116e353
parent 1174 e83fe013f0c5
child 1176 1356c2c32ef6
Don't free ctx->mainfn if context build fails; it wasn't ever set.
mojoshader.c
--- a/mojoshader.c	Sun May 29 02:43:38 2016 -0400
+++ b/mojoshader.c	Sun May 29 02:59:29 2016 -0400
@@ -11158,7 +11158,6 @@
     ctx->errors = errorlist_create(MallocBridge, FreeBridge, ctx);
     if (ctx->errors == NULL)
     {
-        f((void *) ctx->mainfn, d);
         f(ctx, d);
         return NULL;
     } // if
@@ -11166,7 +11165,6 @@
     if (!set_output(ctx, &ctx->mainline))
     {
         errorlist_destroy(ctx->errors);
-        f((void *) ctx->mainfn, d);
         f(ctx, d);
         return NULL;
     } // if