projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support for policy mappings extension.
[openssl.git]
/
crypto
/
x509v3
/
pcy_data.c
diff --git
a/crypto/x509v3/pcy_data.c
b/crypto/x509v3/pcy_data.c
index 614d2b493550790436833e950b880b98ca27450b..3d59f4de23d89a77d16b50be9b1745ac69aad795 100644
(file)
--- a/
crypto/x509v3/pcy_data.c
+++ b/
crypto/x509v3/pcy_data.c
@@
-82,11
+82,21
@@
void policy_data_free(X509_POLICY_DATA *data)
* another source.
*/
* another source.
*/
-X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id, int crit)
+X509_POLICY_DATA *policy_data_new(POLICYINFO *policy,
+ const ASN1_OBJECT *cid, int crit)
{
X509_POLICY_DATA *ret;
{
X509_POLICY_DATA *ret;
- if (!policy && !id)
+ ASN1_OBJECT *id;
+ if (!policy && !cid)
return NULL;
return NULL;
+ if (cid)
+ {
+ id = OBJ_dup(cid);
+ if (!id)
+ return NULL;
+ }
+ else
+ id = NULL;
ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA));
if (!ret)
return NULL;
ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA));
if (!ret)
return NULL;
@@
-94,6
+104,8
@@
X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id, int crit)
if (!ret->expected_policy_set)
{
OPENSSL_free(ret);
if (!ret->expected_policy_set)
{
OPENSSL_free(ret);
+ if (id)
+ ASN1_OBJECT_free(id);
return NULL;
}
return NULL;
}