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 8e4b633ccc5310f85f2f242f73560e51f0c44260..424929471f84261e35c0a580f66d9ad2fb4738da 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);