projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove 0 assignments.
[openssl.git]
/
crypto
/
x509v3
/
pcy_tree.c
diff --git
a/crypto/x509v3/pcy_tree.c
b/crypto/x509v3/pcy_tree.c
index 6b0167b2e38430d6cc3b966568bb3d40a1dbcd30..c6be0151936d2190a2361a3d302e46b2391217d0 100644
(file)
--- a/
crypto/x509v3/pcy_tree.c
+++ b/
crypto/x509v3/pcy_tree.c
@@
-57,7
+57,7
@@
*
*/
*
*/
-#include "cryptlib.h"
+#include "
internal/
cryptlib.h"
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
@@
-217,25
+217,14
@@
static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
}
/* If we get this far initialize the tree */
}
/* If we get this far initialize the tree */
-
- tree = OPENSSL_malloc(sizeof(*tree));
-
+ tree = OPENSSL_zalloc(sizeof(*tree));
if (!tree)
return 0;
if (!tree)
return 0;
-
- tree->flags = 0;
- tree->levels = OPENSSL_malloc(sizeof(*tree->levels) * n);
- tree->nlevel = 0;
- tree->extra_data = NULL;
- tree->auth_policies = NULL;
- tree->user_policies = NULL;
-
+ tree->levels = OPENSSL_zalloc(sizeof(*tree->levels) * n);
if (!tree->levels) {
OPENSSL_free(tree);
return 0;
}
if (!tree->levels) {
OPENSSL_free(tree);
return 0;
}
-
- memset(tree->levels, 0, sizeof(*tree->levels) * n);
tree->nlevel = n;
level = tree->levels;
tree->nlevel = n;
level = tree->levels;
@@
-249,7
+238,7
@@
static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
level++;
x = sk_X509_value(certs, i);
cache = policy_cache_set(x);
level++;
x = sk_X509_value(certs, i);
cache = policy_cache_set(x);
-
CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509
);
+
X509_up_ref(x
);
level->cert = x;
if (!cache->anyPolicy)
level->cert = x;
if (!cache->anyPolicy)
@@
-532,7
+521,7
@@
static int tree_calculate_authority_set(X509_POLICY_TREE *tree,
* If no anyPolicy node on this this level it can't appear on lower
* levels so end search.
*/
* If no anyPolicy node on this this level it can't appear on lower
* levels so end search.
*/
- if (
!(anyptr = curr->anyPolicy)
)
+ if (
(anyptr = curr->anyPolicy) == NULL
)
break;
curr++;
for (j = 0; j < sk_X509_POLICY_NODE_num(curr->nodes); j++) {
break;
curr++;
for (j = 0; j < sk_X509_POLICY_NODE_num(curr->nodes); j++) {