aboutsummaryrefslogtreecommitdiff
path: root/crypto/objects
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-10-30 11:12:26 +0000
committerMatt Caswell <matt@openssl.org>2015-11-09 22:48:41 +0000
commit90945fa31a42dcf3beb90540c618e4d627c595ea (patch)
treee73870c253abf0c37ca618384e30a7937a996b55 /crypto/objects
parenta71edf3ba275b946224b5bcded0a8ecfce1855c0 (diff)
downloadopenssl-90945fa31a42dcf3beb90540c618e4d627c595ea.zip
openssl-90945fa31a42dcf3beb90540c618e4d627c595ea.tar.gz
openssl-90945fa31a42dcf3beb90540c618e4d627c595ea.tar.bz2
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/objects')
-rw-r--r--crypto/objects/o_names.c4
-rw-r--r--crypto/objects/obj_xref.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c
index 7a24ad0..d7441ca 100644
--- a/crypto/objects/o_names.c
+++ b/crypto/objects/o_names.c
@@ -85,7 +85,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
MemCheck_off();
name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
MemCheck_on();
- if (!name_funcs) {
+ if (name_funcs == NULL) {
OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
return (0);
}
@@ -308,7 +308,7 @@ void OBJ_NAME_do_all_sorted(int type,
d.names =
OPENSSL_malloc(sizeof(*d.names) * lh_OBJ_NAME_num_items(names_lh));
/* Really should return an error if !d.names...but its a void function! */
- if (d.names) {
+ if (d.names != NULL) {
d.n = 0;
OBJ_NAME_do_all(type, do_all_sorted_fn, &d);
diff --git a/crypto/objects/obj_xref.c b/crypto/objects/obj_xref.c
index da3469f..6e35f57 100644
--- a/crypto/objects/obj_xref.c
+++ b/crypto/objects/obj_xref.c
@@ -147,16 +147,16 @@ int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid)
int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
{
nid_triple *ntr;
- if (!sig_app)
+ if (sig_app == NULL)
sig_app = sk_nid_triple_new(sig_sk_cmp);
- if (!sig_app)
+ if (sig_app == NULL)
return 0;
- if (!sigx_app)
+ if (sigx_app == NULL)
sigx_app = sk_nid_triple_new(sigx_cmp);
- if (!sigx_app)
+ if (sigx_app == NULL)
return 0;
ntr = OPENSSL_malloc(sizeof(*ntr));
- if (!ntr)
+ if (ntr == NULL)
return 0;
ntr->sign_id = signid;
ntr->hash_id = dig_id;