SHA256
1
0
forked from pool/openCryptoki
openCryptoki/ocki-3.5-icsf-coverity-memoryleakfix.patch
Mark Post d795e80599 - Added the following patches (bsc#986854)
- ocki-3.5-icsf-reasoncode72-support.patch
  - ocki-3.5-icsf-coverity-memoryleakfix.patch
  - ocki-3.5-downgrade-syslogerror.patch
  - ocki-3.5-icsf-sessionhandle-missing-fix.patch
  - ocki-3.5-icsf-reasoncode-2028-added.patch
  - ocki-3.5-added-NULLreturn-check.patch

OBS-URL: https://build.opensuse.org/package/show/security/openCryptoki?expand=0&rev=37
2016-07-08 20:30:53 +00:00

35 lines
1.4 KiB
Diff

commit 54013d80a2f5eaa9ac58712a57de0cd87a55cdae
Author: Jakub Jelen <jjelen@redhat.com>
Date: Thu May 19 17:05:46 2016 -0400
icsftok memory leak fix identified in coverity scan
Signed-off-by: Vineetha Pai <vpishar@us.ibm.com>
diff --git a/usr/lib/pkcs11/icsf_stdll/icsf_specific.c b/usr/lib/pkcs11/icsf_stdll/icsf_specific.c
index 5b7fb45..1c25cd2 100644
--- a/usr/lib/pkcs11/icsf_stdll/icsf_specific.c
+++ b/usr/lib/pkcs11/icsf_stdll/icsf_specific.c
@@ -4664,6 +4664,7 @@ CK_RV icsftok_unwrap_key(SESSION *session, CK_MECHANISM_PTR mech,
"(expected %lu)\n",
(unsigned long) mech->ulParameterLen,
(unsigned long) expected_block_size);
+ free(key_mapping);
return CKR_MECHANISM_PARAM_INVALID;
}
break;
@@ -4671,12 +4672,14 @@ CK_RV icsftok_unwrap_key(SESSION *session, CK_MECHANISM_PTR mech,
if (mech->ulParameterLen != 0){
TRACE_ERROR("%s\n",
ock_err(ERR_MECHANISM_PARAM_INVALID));
+ free(key_mapping);
return CKR_MECHANISM_PARAM_INVALID;
}
break;
default:
TRACE_ERROR("icsf invalid %lu mechanism for key wrapping\n",
mech->mechanism);
+ free(key_mapping);
return CKR_MECHANISM_INVALID;
}