fix potential memory leak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3800 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
f8c6e28bac
commit
2885691a10
|
@ -390,6 +390,7 @@ CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len,
|
||||||
pad = RSA_NO_PADDING;
|
pad = RSA_NO_PADDING;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
return CKR_ARGUMENTS_BAD;
|
return CKR_ARGUMENTS_BAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +401,7 @@ CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len,
|
||||||
|
|
||||||
rsa_out = (unsigned char *) malloc(RSA_size(rsa));
|
rsa_out = (unsigned char *) malloc(RSA_size(rsa));
|
||||||
if (rsa_out == NULL) {
|
if (rsa_out == NULL) {
|
||||||
free(rsa);
|
RSA_free(rsa);
|
||||||
return CKR_DEVICE_MEMORY;
|
return CKR_DEVICE_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue