From a3379e2f78900d6e7186ca49f395d7e0ea6ec1ca Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Thu, 13 Sep 2007 11:53:38 +0000 Subject: [PATCH] (gc_hash_open): Catch NULL calloc return value. Reported by Bruno Haible . --- ChangeLog | 9 +++++++++ lib/gc-gnulib.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index b93f42462..ed569a9cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-13 Simon Josefsson + + * lib/gc-gnulib.c (gc_hash_open): Catch NULL calloc return value. + Reported by Bruno Haible . + 2007-09-12 Bruno Haible * m4/lock.m4: Don't provide an AC_USE_SYSTEM_EXTENSIONS definition. @@ -33005,6 +33010,9 @@ * m4/isc-posix.m4: New file. +<<<<<<< ChangeLog +1998-05-10 Jim Meyering +======= 1998-05-10 Jim Meyering * 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 diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index 7f8d79066..94e08806c 100644 --- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -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; -- 2.11.0