mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
hash: check insertion for memory exhaustion.
* src/muscle-tab.c (muscle_insert, muscle_grow) * src/state.c (state_hash_insert): Check the return value of hash_insert.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2009-06-11 Akim Demaille <demaille@gostai.com>
|
||||
|
||||
hash: check insertion for memory exhaustion.
|
||||
* src/muscle-tab.c (muscle_insert, muscle_grow)
|
||||
* src/state.c (state_hash_insert): Check the return value of
|
||||
hash_insert.
|
||||
|
||||
2009-06-11 Akim Demaille <demaille@gostai.com>
|
||||
|
||||
tests: honor TESTSUITEFLAGS in every check target.
|
||||
|
||||
@@ -120,7 +120,8 @@ muscle_insert (char const *key, char const *value)
|
||||
/* First insertion in the hash. */
|
||||
entry = xmalloc (sizeof *entry);
|
||||
entry->key = key;
|
||||
hash_insert (muscle_table, entry);
|
||||
if (!hash_insert (muscle_table, entry))
|
||||
xalloc_die ();
|
||||
}
|
||||
else
|
||||
free (entry->storage);
|
||||
@@ -149,7 +150,8 @@ muscle_grow (const char *key, const char *val, const char *separator)
|
||||
/* First insertion in the hash. */
|
||||
entry = xmalloc (sizeof *entry);
|
||||
entry->key = key;
|
||||
hash_insert (muscle_table, entry);
|
||||
if (!hash_insert (muscle_table, entry))
|
||||
xalloc_die ();
|
||||
entry->value = entry->storage = xstrdup (val);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -379,7 +379,8 @@ state_hash_free (void)
|
||||
void
|
||||
state_hash_insert (state *s)
|
||||
{
|
||||
hash_insert (state_table, s);
|
||||
if (!hash_insert (state_table, s))
|
||||
xalloc_die ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user