diff options
Diffstat (limited to 'src/lib/libcrypto/x509v3/pcy_data.c')
-rw-r--r-- | src/lib/libcrypto/x509v3/pcy_data.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509v3/pcy_data.c b/src/lib/libcrypto/x509v3/pcy_data.c index 614d2b4935..fb392b901f 100644 --- a/src/lib/libcrypto/x509v3/pcy_data.c +++ b/src/lib/libcrypto/x509v3/pcy_data.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* pcy_data.c */ | 1 | /* pcy_data.c */ |
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2004. | 3 | * project 2004. |
4 | */ | 4 | */ |
5 | /* ==================================================================== | 5 | /* ==================================================================== |
@@ -87,6 +87,12 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id, int crit) | |||
87 | X509_POLICY_DATA *ret; | 87 | X509_POLICY_DATA *ret; |
88 | if (!policy && !id) | 88 | if (!policy && !id) |
89 | return NULL; | 89 | return NULL; |
90 | if (id) | ||
91 | { | ||
92 | id = OBJ_dup(id); | ||
93 | if (!id) | ||
94 | return NULL; | ||
95 | } | ||
90 | ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA)); | 96 | ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA)); |
91 | if (!ret) | 97 | if (!ret) |
92 | return NULL; | 98 | return NULL; |
@@ -94,6 +100,8 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id, int crit) | |||
94 | if (!ret->expected_policy_set) | 100 | if (!ret->expected_policy_set) |
95 | { | 101 | { |
96 | OPENSSL_free(ret); | 102 | OPENSSL_free(ret); |
103 | if (id) | ||
104 | ASN1_OBJECT_free(id); | ||
97 | return NULL; | 105 | return NULL; |
98 | } | 106 | } |
99 | 107 | ||