Check malloc
authorRich Salz <rsalz@akamai.com>
Thu, 11 Feb 2016 14:12:33 +0000 (09:12 -0500)
committerRich Salz <rsalz@openssl.org>
Thu, 11 Feb 2016 14:21:35 +0000 (09:21 -0500)
Noticed by Claus Assmann <ca+ssl-dev@esmtp.org>

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/conf/conf_lib.c

index 29357b2..a84b643 100644 (file)
@@ -381,7 +381,8 @@ OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void)
 {
     OPENSSL_INIT_SETTINGS *ret = malloc(sizeof(*ret));
 
-    memset(ret, 0, sizeof(*ret));
+    if (ret != NULL)
+        memset(ret, 0, sizeof(*ret));
     return ret;
 }