[openssl-dev] OPENSSL_INIT_new(): malloc()

Claus Assmann ca+ssl-dev at esmtp.org
Thu Feb 11 13:54:07 UTC 2016


commit 7253fd550c768979ecd3df8f4dbbedd6e9dd76b0

diff --git a/crypto/conf/conf_lib.c b/crypto/conf/conf_lib.c

+/*
+ * These routines call the C malloc/free, to avoid intermixing with
+ * OpenSSL function pointers before the library is initialized.
+ */
+OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void)
+{
+    OPENSSL_INIT_SETTINGS *ret = malloc(sizeof(*ret));
+
+    memset(ret, 0, sizeof(*ret));

If that's a "normal" malloc(), couldn't it return NULL?
Should that be checked?


More information about the openssl-dev mailing list