diff options
Diffstat (limited to 'src/lib/libcrypto/cms')
-rw-r--r-- | src/lib/libcrypto/cms/cms_asn1.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/cms/cms_sd.c | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/libcrypto/cms/cms_asn1.c b/src/lib/libcrypto/cms/cms_asn1.c index e450259832..42e33d5b46 100644 --- a/src/lib/libcrypto/cms/cms_asn1.c +++ b/src/lib/libcrypto/cms/cms_asn1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_asn1.c,v 1.7 2015/09/10 15:56:25 jsing Exp $ */ | 1 | /* $OpenBSD: cms_asn1.c,v 1.8 2016/03/11 07:08:44 mmcc Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -220,8 +220,7 @@ cms_si_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) | |||
220 | if (operation == ASN1_OP_FREE_POST) { | 220 | if (operation == ASN1_OP_FREE_POST) { |
221 | CMS_SignerInfo *si = (CMS_SignerInfo *)*pval; | 221 | CMS_SignerInfo *si = (CMS_SignerInfo *)*pval; |
222 | EVP_PKEY_free(si->pkey); | 222 | EVP_PKEY_free(si->pkey); |
223 | if (si->signer) | 223 | X509_free(si->signer); |
224 | X509_free(si->signer); | ||
225 | } | 224 | } |
226 | return 1; | 225 | return 1; |
227 | } | 226 | } |
@@ -883,8 +882,7 @@ cms_ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) | |||
883 | if (ri->type == CMS_RECIPINFO_TRANS) { | 882 | if (ri->type == CMS_RECIPINFO_TRANS) { |
884 | CMS_KeyTransRecipientInfo *ktri = ri->d.ktri; | 883 | CMS_KeyTransRecipientInfo *ktri = ri->d.ktri; |
885 | EVP_PKEY_free(ktri->pkey); | 884 | EVP_PKEY_free(ktri->pkey); |
886 | if (ktri->recip) | 885 | X509_free(ktri->recip); |
887 | X509_free(ktri->recip); | ||
888 | } else if (ri->type == CMS_RECIPINFO_KEK) { | 886 | } else if (ri->type == CMS_RECIPINFO_KEK) { |
889 | CMS_KEKRecipientInfo *kekri = ri->d.kekri; | 887 | CMS_KEKRecipientInfo *kekri = ri->d.kekri; |
890 | if (kekri->key) { | 888 | if (kekri->key) { |
diff --git a/src/lib/libcrypto/cms/cms_sd.c b/src/lib/libcrypto/cms/cms_sd.c index f4119f7a1c..1623126e77 100644 --- a/src/lib/libcrypto/cms/cms_sd.c +++ b/src/lib/libcrypto/cms/cms_sd.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_sd.c,v 1.9 2014/11/09 19:17:13 miod Exp $ */ | 1 | /* $OpenBSD: cms_sd.c,v 1.10 2016/03/11 07:08:44 mmcc Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -498,8 +498,7 @@ CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer) | |||
498 | EVP_PKEY_free(si->pkey); | 498 | EVP_PKEY_free(si->pkey); |
499 | si->pkey = X509_get_pubkey(signer); | 499 | si->pkey = X509_get_pubkey(signer); |
500 | } | 500 | } |
501 | if (si->signer) | 501 | X509_free(si->signer); |
502 | X509_free(si->signer); | ||
503 | si->signer = signer; | 502 | si->signer = signer; |
504 | } | 503 | } |
505 | 504 | ||