Fix: allocating just a pointer instead of the whole struct.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 2 Sep 2010 23:53:14 +0000 (19:53 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 2 Sep 2010 23:53:14 +0000 (19:53 -0400)
src/aop-header.c

index b3cad5a05fdf385a6588e49d954a9685f59c11b5..7ab4164f3d09fc85675a71432bf62c294e7509ed 100644 (file)
@@ -232,8 +232,7 @@ insert_prototype (bool has_return_value, const char *name, int num_params,
   /* Allocate the new prototype and insert it in the hash table (or in
      the linked list if we happened to find a hash table entry
      already). */
-  prototype = xmalloc (sizeof (struct aop_prototype *) + 
-                      (num_params * sizeof (const struct aop_type *)));
+  prototype = xmalloc (sizeof (struct aop_prototype) + param_types_size);
   *hash_slot = prototype;
 
   prototype->has_return_value = has_return_value;