Fixed allocation bug.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 03 Feb 2009 04:09:25 -0500
changeset 540 e65090ad5caa
parent 539 8a26cb9a148f
child 541 0240ccafb610
Fixed allocation bug.
mojoshader.c
--- a/mojoshader.c	Tue Feb 03 01:56:07 2009 -0500
+++ b/mojoshader.c	Tue Feb 03 04:09:25 2009 -0500
@@ -7092,8 +7092,8 @@
 static MOJOSHADER_error *build_errors(Context *ctx)
 {
     int total = 0;
-    MOJOSHADER_error *retval;
-    retval = (MOJOSHADER_error *) Malloc(ctx, sizeof (MOJOSHADER_error));
+    MOJOSHADER_error *retval = (MOJOSHADER_error *)
+            Malloc(ctx, sizeof (MOJOSHADER_error) * ctx->error_count);
     if (retval == NULL)
         return NULL;