JPAKE_CTX_new: check for NULL result when allocating ctx
authorJonas Maebe <jonas.maebe@elis.ugent.be>
Sun, 8 Dec 2013 17:14:10 +0000 (18:14 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Sun, 17 Aug 2014 16:54:11 +0000 (18:54 +0200)
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
crypto/jpake/jpake.c

index 8e4b633..4249294 100644 (file)
@@ -117,6 +117,8 @@ JPAKE_CTX *JPAKE_CTX_new(const char *name, const char *peer_name,
                         const BIGNUM *secret)
     {
     JPAKE_CTX *ctx = OPENSSL_malloc(sizeof *ctx);
+    if (ctx == NULL)
+        return NULL;
 
     JPAKE_CTX_init(ctx, name, peer_name, p, g, q, secret);