(parse_rsa_private_key): free type earlier.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18263 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -210,16 +210,18 @@ parse_rsa_private_key(hx509_context context, struct hx509_collector *c,
|
|||||||
#define PKCS5_SALT_LEN 8
|
#define PKCS5_SALT_LEN 8
|
||||||
|
|
||||||
ssize = hex_decode(iv, ivdata, size);
|
ssize = hex_decode(iv, ivdata, size);
|
||||||
|
free(type);
|
||||||
|
type = NULL;
|
||||||
|
iv = NULL;
|
||||||
|
|
||||||
if (ssize < 0 || ssize < PKCS5_SALT_LEN || ssize < EVP_CIPHER_iv_length(cipher)) {
|
if (ssize < 0 || ssize < PKCS5_SALT_LEN || ssize < EVP_CIPHER_iv_length(cipher)) {
|
||||||
free(ivdata);
|
free(ivdata);
|
||||||
free(type);
|
|
||||||
hx509_clear_error_string(context);
|
hx509_clear_error_string(context);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
key = malloc(EVP_CIPHER_key_length(cipher));
|
key = malloc(EVP_CIPHER_key_length(cipher));
|
||||||
if (key == NULL) {
|
if (key == NULL) {
|
||||||
free(type);
|
|
||||||
free(ivdata);
|
free(ivdata);
|
||||||
hx509_clear_error_string(context);
|
hx509_clear_error_string(context);
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
@@ -228,7 +230,6 @@ parse_rsa_private_key(hx509_context context, struct hx509_collector *c,
|
|||||||
ret = EVP_BytesToKey(cipher, EVP_md5(), ivdata,
|
ret = EVP_BytesToKey(cipher, EVP_md5(), ivdata,
|
||||||
password, passwordlen,
|
password, passwordlen,
|
||||||
1, key, NULL);
|
1, key, NULL);
|
||||||
free(type);
|
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
free(key);
|
free(key);
|
||||||
free(ivdata);
|
free(ivdata);
|
||||||
|
Reference in New Issue
Block a user