(gc_hash_open): Catch NULL calloc return value.
authorSimon Josefsson <simon@josefsson.org>
Thu, 13 Sep 2007 11:53:38 +0000 (11:53 +0000)
committerSimon Josefsson <simon@josefsson.org>
Thu, 13 Sep 2007 11:53:38 +0000 (11:53 +0000)
Reported by Bruno Haible <bruno@clisp.org>.

ChangeLog
lib/gc-gnulib.c

index b93f424627c6a7aaf8ed32d46e533096c8e6867f..ed569a9cf26af44237b2db383e80e8aab52e3f9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-13  Simon Josefsson  <simon@josefsson.org>
+
+       * lib/gc-gnulib.c (gc_hash_open): Catch NULL calloc return value.
+       Reported by Bruno Haible <bruno@clisp.org>.
+
 2007-09-12  Bruno Haible  <bruno@clisp.org>
 
        * m4/lock.m4: Don't provide an AC_USE_SYSTEM_EXTENSIONS definition.
 
        * m4/isc-posix.m4: New file.
 
+<<<<<<< ChangeLog
+1998-05-10  Jim Meyering  <meyering@ascend.com>
+=======
 1998-05-10  Jim Meyering  <meyering@ascend.com>
 
        * m4/jm-mktime.m4: Use AM_FUNC_MKTIME, now that it's up to date.
@@ -33083,3 +33091,4 @@ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
   Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted provided the copyright notice and this notice are preserved.
+>>>>>>> 1.1932
index 7f8d79066be567f28533ea64945be78fb6f8dc39..94e08806c5b780e1f47d6a3225452c6009dd74f7 100644 (file)
@@ -581,6 +581,8 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
   Gc_rc rc = GC_OK;
 
   ctx = calloc (sizeof (*ctx), 1);
+  if (!ctx)
+    return GC_MALLOC_ERROR;
 
   ctx->alg = hash;
   ctx->mode = mode;