summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-04-27 14:06:40 +0100
committerMatt Caswell <matt@openssl.org>2016-04-28 13:13:09 +0100
commit460c5e1d2f7388216f12d345d13202381b30e2a3 (patch)
tree387293d511d7da14cb7a7cd9175dd4a69f118a15 /crypto/pkcs12
parent8e588e2812f82419fb177e42480b4edffc676070 (diff)
Don't leak memory on error in PKCS12_key_gen_uni
The PKCS12_key_gen_uni() had one error path which did not free memory correctly. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r--crypto/pkcs12/p12_key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c
index 6a9a3254b1..1a1ea7059c 100644
--- a/crypto/pkcs12/p12_key.c
+++ b/crypto/pkcs12/p12_key.c
@@ -129,7 +129,7 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
v = EVP_MD_block_size(md_type);
u = EVP_MD_size(md_type);
if (u < 0)
- return 0;
+ goto err;
D = OPENSSL_malloc(v);
Ai = OPENSSL_malloc(u);
B = OPENSSL_malloc(v + 1);