From: Paul Smith Date: Fri, 17 May 2013 05:24:19 +0000 (-0400) Subject: Use xcalloc() in hash.c to handle out of memory errors. X-Git-Tag: 3.99.90~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=398058a8738fc6a2f0051b236a907cb621aefabc;p=thirdparty%2Fmake.git Use xcalloc() in hash.c to handle out of memory errors. --- diff --git a/ChangeLog b/ChangeLog index d9c31678..c9628105 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2013-05-17 Paul Smith + * 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. diff --git a/hash.c b/hash.c index d1c2faca..ca2d02d6 100644 --- a/hash.c +++ b/hash.c @@ -17,7 +17,7 @@ this program. If not, see . */ #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)))