From af50ddfc8cd7409b6577826223496779c69cd1e0 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Mon, 21 Apr 2014 08:41:26 +0000 Subject: KNF. --- src/lib/libcrypto/x509v3/pcy_data.c | 43 ++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 24 deletions(-) (limited to 'src/lib/libcrypto/x509v3/pcy_data.c') diff --git a/src/lib/libcrypto/x509v3/pcy_data.c b/src/lib/libcrypto/x509v3/pcy_data.c index 7c80915f5b..bf33bdd5d0 100644 --- a/src/lib/libcrypto/x509v3/pcy_data.c +++ b/src/lib/libcrypto/x509v3/pcy_data.c @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -64,16 +64,17 @@ /* Policy Node routines */ -void policy_data_free(X509_POLICY_DATA *data) - { +void +policy_data_free(X509_POLICY_DATA *data) +{ ASN1_OBJECT_free(data->valid_policy); /* Don't free qualifiers if shared */ if (!(data->flags & POLICY_DATA_FLAG_SHARED_QUALIFIERS)) sk_POLICYQUALINFO_pop_free(data->qualifier_set, - POLICYQUALINFO_free); + POLICYQUALINFO_free); sk_ASN1_OBJECT_pop_free(data->expected_policy_set, ASN1_OBJECT_free); free(data); - } +} /* Create a data based on an existing policy. If 'id' is NULL use the * oid in the policy, otherwise use 'id'. This behaviour covers the two @@ -82,32 +83,30 @@ void policy_data_free(X509_POLICY_DATA *data) * another source. */ -X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, - const ASN1_OBJECT *cid, int crit) - { +X509_POLICY_DATA * +policy_data_new(POLICYINFO *policy, const ASN1_OBJECT *cid, int crit) +{ X509_POLICY_DATA *ret; ASN1_OBJECT *id; + if (!policy && !cid) return NULL; - if (cid) - { + if (cid) { id = OBJ_dup(cid); if (!id) return NULL; - } - else + } else id = NULL; ret = malloc(sizeof(X509_POLICY_DATA)); if (!ret) return NULL; ret->expected_policy_set = sk_ASN1_OBJECT_new_null(); - if (!ret->expected_policy_set) - { + if (!ret->expected_policy_set) { free(ret); if (id) ASN1_OBJECT_free(id); return NULL; - } + } if (crit) ret->flags = POLICY_DATA_FLAG_CRITICAL; @@ -116,20 +115,16 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, if (id) ret->valid_policy = id; - else - { + else { ret->valid_policy = policy->policyid; policy->policyid = NULL; - } + } - if (policy) - { + if (policy) { ret->qualifier_set = policy->qualifiers; policy->qualifiers = NULL; - } - else + } else ret->qualifier_set = NULL; return ret; - } - +} -- cgit v1.2.3-55-g6feb