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 29357b26ad42cde3c1d933b86e40626569f8f10f..a84b643fc248d245f10d211cae275e6ced35ff05 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;
 }