X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fx509v3%2Fpcy_cache.c;h=64fe3bc598b245f7f8cd0378e261c9193ee10f2b;hb=99119000add47e4d1d9241f4e76f57d98439a766;hp=1f942604d8ef75372c61fb7f0c6dcd39912a9708;hpb=25aaa98aa249d26391c1994d2de449562c8b8b99;p=oweals%2Fopenssl.git diff --git a/crypto/x509v3/pcy_cache.c b/crypto/x509v3/pcy_cache.c index 1f942604d8..64fe3bc598 100644 --- a/crypto/x509v3/pcy_cache.c +++ b/crypto/x509v3/pcy_cache.c @@ -1,4 +1,3 @@ -/* pcy_cache.c */ /* * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project * 2004. @@ -57,9 +56,10 @@ * */ -#include "cryptlib.h" +#include "internal/cryptlib.h" #include #include +#include "internal/x509_int.h" #include "pcy_int.h" @@ -83,12 +83,12 @@ static int policy_cache_create(X509 *x, if (sk_POLICYINFO_num(policies) == 0) goto bad_policy; cache->data = sk_X509_POLICY_DATA_new(policy_data_cmp); - if (!cache->data) + if (cache->data == NULL) goto bad_policy; for (i = 0; i < sk_POLICYINFO_num(policies); i++) { policy = sk_POLICYINFO_value(policies, i); data = policy_data_new(policy, NULL, crit); - if (!data) + if (data == NULL) goto bad_policy; /* * Duplicate policy OIDs are illegal: reject if matches found. @@ -127,8 +127,8 @@ static int policy_cache_new(X509 *x) CERTIFICATEPOLICIES *ext_cpols = NULL; POLICY_MAPPINGS *ext_pmaps = NULL; int i; - cache = OPENSSL_malloc(sizeof(X509_POLICY_CACHE)); - if (!cache) + cache = OPENSSL_malloc(sizeof(*cache)); + if (cache == NULL) return 0; cache->anyPolicy = NULL; cache->data = NULL;