diff options
author | Rich Salz <rsalz@akamai.com> | 2015-09-03 09:15:26 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-09-03 16:26:34 -0400 |
commit | 64b25758edca688a30f02c260262150f7ad0bc7d (patch) | |
tree | 15ad5a8c7985e2b27aaf7a14737fd980a36349dd /crypto/x509v3 | |
parent | fb4844bbc62fb014c115cd8fd2fc4304cba6eb89 (diff) |
remove 0 assignments.
After openssl_zalloc, cleanup more "set to 0/NULL" assignments.
Many are from github feedback.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/x509v3')
-rw-r--r-- | crypto/x509v3/Makefile | 29 | ||||
-rw-r--r-- | crypto/x509v3/pcy_data.c | 7 | ||||
-rw-r--r-- | crypto/x509v3/pcy_node.c | 4 | ||||
-rw-r--r-- | crypto/x509v3/pcy_tree.c | 6 |
4 files changed, 20 insertions, 26 deletions
diff --git a/crypto/x509v3/Makefile b/crypto/x509v3/Makefile index 516e7ad4dd..5c47467805 100644 --- a/crypto/x509v3/Makefile +++ b/crypto/x509v3/Makefile @@ -505,20 +505,21 @@ v3_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h v3_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h v3_prn.o: ../../include/openssl/x509v3.h ../include/internal/cryptlib.h v3_prn.o: v3_prn.c -v3_purp.o: ../../e_os.h ../../include/openssl/asn1.h -v3_purp.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h -v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h -v3_purp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -v3_purp.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h -v3_purp.o: ../../include/openssl/err.h ../../include/openssl/evp.h -v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h -v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h -v3_purp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -v3_purp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h -v3_purp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h -v3_purp.o: ../include/internal/cryptlib.h v3_purp.c +v3_purp.o: ../../e_os.h ../../include/internal/numbers.h +v3_purp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +v3_purp.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h +v3_purp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +v3_purp.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h +v3_purp.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h +v3_purp.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h +v3_purp.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +v3_purp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +v3_purp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h +v3_purp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +v3_purp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h +v3_purp.o: ../../include/openssl/x509v3.h ../include/internal/cryptlib.h +v3_purp.o: v3_purp.c v3_scts.o: ../../e_os.h ../../include/openssl/asn1.h v3_scts.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h v3_scts.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h diff --git a/crypto/x509v3/pcy_data.c b/crypto/x509v3/pcy_data.c index c29641f2c6..bb2760abc2 100644 --- a/crypto/x509v3/pcy_data.c +++ b/crypto/x509v3/pcy_data.c @@ -98,7 +98,7 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, return NULL; } else id = NULL; - ret = OPENSSL_malloc(sizeof(*ret)); + ret = OPENSSL_zalloc(sizeof(*ret)); if (!ret) return NULL; ret->expected_policy_set = sk_ASN1_OBJECT_new_null(); @@ -110,8 +110,6 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, if (crit) ret->flags = POLICY_DATA_FLAG_CRITICAL; - else - ret->flags = 0; if (id) ret->valid_policy = id; @@ -123,8 +121,7 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, if (policy) { ret->qualifier_set = policy->qualifiers; policy->qualifiers = NULL; - } else - ret->qualifier_set = NULL; + } return ret; } diff --git a/crypto/x509v3/pcy_node.c b/crypto/x509v3/pcy_node.c index 855fe3ed94..64f979a32a 100644 --- a/crypto/x509v3/pcy_node.c +++ b/crypto/x509v3/pcy_node.c @@ -114,12 +114,12 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, X509_POLICY_TREE *tree) { X509_POLICY_NODE *node; - node = OPENSSL_malloc(sizeof(*node)); + + node = OPENSSL_zalloc(sizeof(*node)); if (!node) return NULL; node->data = data; node->parent = parent; - node->nchild = 0; if (level) { if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) { if (level->anyPolicy) diff --git a/crypto/x509v3/pcy_tree.c b/crypto/x509v3/pcy_tree.c index 2a41903a72..c6be015193 100644 --- a/crypto/x509v3/pcy_tree.c +++ b/crypto/x509v3/pcy_tree.c @@ -217,7 +217,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, } /* If we get this far initialize the tree */ - tree = OPENSSL_malloc(sizeof(*tree)); + tree = OPENSSL_zalloc(sizeof(*tree)); if (!tree) return 0; tree->levels = OPENSSL_zalloc(sizeof(*tree->levels) * n); @@ -225,10 +225,6 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, OPENSSL_free(tree); return 0; } - tree->flags = 0; - tree->extra_data = NULL; - tree->auth_policies = NULL; - tree->user_policies = NULL; tree->nlevel = n; level = tree->levels; |