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:
s 2009-11-01 14:11:41 +00:00
parent f8c6e28bac
commit 2885691a10
1 changed files with 2 additions and 1 deletions

View File

@ -390,6 +390,7 @@ CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len,
pad = RSA_NO_PADDING;
break;
default:
EVP_PKEY_free(pkey);
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));
if (rsa_out == NULL) {
free(rsa);
RSA_free(rsa);
return CKR_DEVICE_MEMORY;
}