summaryrefslogtreecommitdiff
path: root/lib/gc-gnulib.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2007-09-13 11:53:38 +0000
committerSimon Josefsson <simon@josefsson.org>2007-09-13 11:53:38 +0000
commita3379e2f78900d6e7186ca49f395d7e0ea6ec1ca (patch)
tree817c8af193b1603cdb4c3e8e4c3aea1c5324c631 /lib/gc-gnulib.c
parent74f8d5870e0fd68701ff379775a5f0a439bfb5b3 (diff)
downloadgnulib-a3379e2f78900d6e7186ca49f395d7e0ea6ec1ca.tar.gz
(gc_hash_open): Catch NULL calloc return value.
Reported by Bruno Haible <bruno@clisp.org>.
Diffstat (limited to 'lib/gc-gnulib.c')
-rw-r--r--lib/gc-gnulib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c
index 7f8d79066b..94e08806c5 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;