mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-27 09:43:41 +00:00
Use xcalloc() in hash.c to handle out of memory errors.
This commit is contained in:
parent
b730fbc6b8
commit
398058a873
2 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
2013-05-17 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* hash.c (CALLOC): Use xcalloc() to handle out of memory errors.
|
||||
|
||||
* makeint.h: Prototype new unload_file() function.
|
||||
* load.c (unload_file): Create a function to unload a file.
|
||||
(struct load_list): Type to remember loaded objects.
|
||||
|
|
2
hash.c
2
hash.c
|
@ -17,7 +17,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include "makeint.h"
|
||||
#include "hash.h"
|
||||
|
||||
#define CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))
|
||||
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
|
||||
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
|
||||
#define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n)))
|
||||
#define CLONE(o, t, n) ((t *) memcpy (MALLOC (t, (n)), (o), sizeof (t) * (n)))
|
||||
|
|
Loading…
Reference in a new issue