summaryrefslogtreecommitdiffstats
path: root/crypto/conf/conf_mod.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2018-04-03 17:31:16 +0200
committerRich Salz <rsalz@openssl.org>2018-04-03 17:31:16 +0200
commitcdb10bae3f773401e039c55965eb177a6f3fc160 (patch)
treec69b1b2bc385d3f600684cf8285b9ff80322c48f /crypto/conf/conf_mod.c
parentFix some errors in the mem leaks docs (diff)
downloadopenssl-cdb10bae3f773401e039c55965eb177a6f3fc160.tar.xz
openssl-cdb10bae3f773401e039c55965eb177a6f3fc160.zip
Set error code on alloc failures
Almost all *alloc failures now set an error code. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/5842)
Diffstat (limited to 'crypto/conf/conf_mod.c')
-rw-r--r--crypto/conf/conf_mod.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c
index 7622d8e1f3..99f0fcc2b5 100644
--- a/crypto/conf/conf_mod.c
+++ b/crypto/conf/conf_mod.c
@@ -232,9 +232,10 @@ static CONF_MODULE *module_add(DSO *dso, const char *name,
supported_modules = sk_CONF_MODULE_new_null();
if (supported_modules == NULL)
return NULL;
- tmod = OPENSSL_zalloc(sizeof(*tmod));
- if (tmod == NULL)
+ if ((tmod = OPENSSL_zalloc(sizeof(*tmod))) == NULL) {
+ CONFerr(CONF_F_MODULE_ADD, ERR_R_MALLOC_FAILURE);
return NULL;
+ }
tmod->dso = dso;
tmod->name = OPENSSL_strdup(name);