diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-30 11:12:26 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-09 22:48:41 +0000 |
commit | 90945fa31a42dcf3beb90540c618e4d627c595ea (patch) | |
tree | e73870c253abf0c37ca618384e30a7937a996b55 /crypto/conf | |
parent | a71edf3ba275b946224b5bcded0a8ecfce1855c0 (diff) |
Continue standardising malloc style for libcrypto
Continuing from previous commit ensure our style is consistent for malloc
return checks.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_def.c | 2 | ||||
-rw-r--r-- | crypto/conf/conf_mod.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 1da68f9334..1ff49aa281 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -129,7 +129,7 @@ static CONF *def_create(CONF_METHOD *meth) CONF *ret; ret = OPENSSL_malloc(sizeof(*ret)); - if (ret) + if (ret != NULL) if (meth->init(ret) == 0) { OPENSSL_free(ret); ret = NULL; diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index c23a0f6a46..c1fbb601d5 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -166,7 +166,7 @@ int CONF_modules_load_file(const char *filename, const char *appname, CONF *conf = NULL; int ret = 0; conf = NCONF_new(NULL); - if (!conf) + if (conf == NULL) goto err; if (filename == NULL) { @@ -336,7 +336,7 @@ static int module_init(CONF_MODULE *pmod, char *name, char *value, /* Otherwise add initialized module to list */ imod = OPENSSL_malloc(sizeof(*imod)); - if (!imod) + if (imod == NULL) goto err; imod->pmod = pmod; @@ -535,7 +535,7 @@ char *CONF_get1_default_config_file(void) file = OPENSSL_malloc(len + 1); - if (!file) + if (file == NULL) return NULL; BUF_strlcpy(file, X509_get_default_cert_area(), len + 1); #ifndef OPENSSL_SYS_VMS |