diff options
Diffstat (limited to 'crypto/pkcs12/p12_npas.c')
-rw-r--r-- | crypto/pkcs12/p12_npas.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/pkcs12/p12_npas.c b/crypto/pkcs12/p12_npas.c index ee35c45abb..7f04ce10de 100644 --- a/crypto/pkcs12/p12_npas.c +++ b/crypto/pkcs12/p12_npas.c @@ -157,8 +157,10 @@ static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, if ((p8 = PKCS8_decrypt(bag->value.shkeybag, oldpass, -1)) == NULL) return 0; X509_SIG_get0(bag->value.shkeybag, &shalg, NULL); - if (!alg_get(shalg, &p8_nid, &p8_iter, &p8_saltlen)) + if (!alg_get(shalg, &p8_nid, &p8_iter, &p8_saltlen)) { + PKCS8_PRIV_KEY_INFO_free(p8); return 0; + } p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen, p8_iter, p8); PKCS8_PRIV_KEY_INFO_free(p8); |