]> git.saurik.com Git - bison.git/blobdiff - src/symtab.c
Fix some memory leaks.
[bison.git] / src / symtab.c
index e68e473b12ab8f100739c58c4ed05017b3e37578..727ac2c7390f2cd3cde58502053ddf53fe5d8326 100644 (file)
@@ -735,7 +735,8 @@ symbol_from_uniqstr (const uniqstr key, location loc)
     {
       /* First insertion in the hash. */
       entry = symbol_new (key, loc);
-      hash_insert (symbol_table, entry);
+      if (!hash_insert (symbol_table, entry))
+        xalloc_die ();
     }
   return entry;
 }
@@ -759,7 +760,8 @@ semantic_type_from_uniqstr (const uniqstr key)
     {
       /* First insertion in the hash. */
       entry = semantic_type_new (key);
-      hash_insert (semantic_type_table, entry);
+      if (!hash_insert (semantic_type_table, entry))
+        xalloc_die ();
     }
   return entry;
 }