* gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
[pspp] / lib / gc-libgcrypt.c
index bc0d12bbaf6b16aae69cafde317effe89dba9252..10841e8d43ada764c9e4a64d27c10d3a45811bcb 100644 (file)
@@ -243,6 +243,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;