mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
hash: check insertion for memory exhaustion.
* src/uniqstr.c (uniqstr_new): New.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-06-25 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
|
hash: check insertion for memory exhaustion.
|
||||||
|
* src/uniqstr.c (uniqstr_new): New.
|
||||||
|
|
||||||
2009-06-11 Akim Demaille <demaille@gostai.com>
|
2009-06-11 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
style changes.
|
style changes.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Keep a unique copy of strings.
|
/* Keep a unique copy of strings.
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -47,7 +47,8 @@ uniqstr_new (char const *str)
|
|||||||
{
|
{
|
||||||
/* First insertion in the hash. */
|
/* First insertion in the hash. */
|
||||||
res = xstrdup (str);
|
res = xstrdup (str);
|
||||||
hash_insert (uniqstrs_table, res);
|
if (!hash_insert (uniqstrs_table, res))
|
||||||
|
xalloc_die ();
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user