diff options
author | tb <> | 2022-07-24 18:41:08 +0000 |
---|---|---|
committer | tb <> | 2022-07-24 18:41:08 +0000 |
commit | e80ee4f0364e6cd16a763c80d647458d42623477 (patch) | |
tree | 2b77ebe29ddd2da14e39aeae75edfd6aed1b8cb1 /src | |
parent | c11e30e0ed7158f7f63729cc4ea6cc5d05933b96 (diff) | |
download | openbsd-e80ee4f0364e6cd16a763c80d647458d42623477.tar.gz openbsd-e80ee4f0364e6cd16a763c80d647458d42623477.tar.bz2 openbsd-e80ee4f0364e6cd16a763c80d647458d42623477.zip |
Plug a leak in PKCS12_setup_mac()
based on OpenSSL 1b8f1937 by Dmitry Belyavskiy
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_mutl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c index f3a6ea3ba3..aaba1e74de 100644 --- a/src/lib/libcrypto/pkcs12/p12_mutl.c +++ b/src/lib/libcrypto/pkcs12/p12_mutl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: p12_mutl.c,v 1.27 2021/12/12 21:30:14 tb Exp $ */ | 1 | /* $OpenBSD: p12_mutl.c,v 1.28 2022/07/24 18:41:08 tb 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 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -174,7 +174,8 @@ int | |||
174 | PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, | 174 | PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, |
175 | const EVP_MD *md_type) | 175 | const EVP_MD *md_type) |
176 | { | 176 | { |
177 | if (!(p12->mac = PKCS12_MAC_DATA_new())) | 177 | PKCS12_MAC_DATA_free(p12->mac); |
178 | if ((p12->mac = PKCS12_MAC_DATA_new()) == NULL) | ||
178 | return PKCS12_ERROR; | 179 | return PKCS12_ERROR; |
179 | if (iter > 1) { | 180 | if (iter > 1) { |
180 | if (!(p12->mac->iter = ASN1_INTEGER_new())) { | 181 | if (!(p12->mac->iter = ASN1_INTEGER_new())) { |