* gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
[pspp] / lib / gc-gnulib.c
index 61143b0de28a286508278285bf9931215e2fb1a2..c0fa2e3e2c6e4f6e8ca7afe09194f65edf742265 100644 (file)
@@ -192,6 +192,8 @@ gc_cipher_open (Gc_cipher alg, Gc_cipher_mode mode,
   Gc_rc rc = GC_OK;
 
   ctx = calloc (sizeof (*ctx), 1);
+  if (!ctx)
+    return GC_MALLOC_ERROR;
 
   ctx->alg = alg;
   ctx->mode = mode;