openCryptoki/ocki-3.5-icsf-coverity-memoryleakfix.patch

35 lines
1.4 KiB
Diff
Raw Normal View History

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;
}