diff options
author | Simon Josefsson <simon@josefsson.org> | 2007-09-13 11:53:38 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2007-09-13 11:53:38 +0000 |
commit | a3379e2f78900d6e7186ca49f395d7e0ea6ec1ca (patch) | |
tree | 817c8af193b1603cdb4c3e8e4c3aea1c5324c631 /lib/gc-gnulib.c | |
parent | 74f8d5870e0fd68701ff379775a5f0a439bfb5b3 (diff) | |
download | gnulib-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.c | 2 |
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; |