Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: src/tspi/obj_context.c

Issue 3581012: Upgrade from trousers 0.3.3 to 0.3.6 and from testsuite 0.2 to 0.3. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/trousers.git
Patch Set: git cl push Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/tspi/Makefile.am ('k') | src/tspi/obj_rsakey.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tspi/obj_context.c
diff --git a/src/tspi/obj_context.c b/src/tspi/obj_context.c
index b2a0f63e0aa41439be8d1703a8f878b35713be4a..cb2091e6fe1f62348d2b51c3ed2f328fce243e2c 100644
--- a/src/tspi/obj_context.c
+++ b/src/tspi/obj_context.c
@@ -187,7 +187,11 @@ obj_context_get_machine_name(TSS_HCONTEXT tspContext, UINT32 *size, BYTE **data)
*data = NULL;
*size = 0;
} else {
- *data = calloc_tspi(obj->tspContext, context->machineNameLength);
+ /*
+ * Don't use calloc_tspi because this memory is
+ * not freed using "free_tspi"
+ */
+ *data = calloc(1, context->machineNameLength);
if (*data == NULL) {
LogError("malloc of %u bytes failed.",
context->machineNameLength);
@@ -963,6 +967,7 @@ do_transport_decryption(TPM_TRANSPORT_PUBLIC *transPub,
default:
LogDebug("Unknown algorithm for encrypted transport session: 0x%x",
transPub->algId);
+ free(dec);
return TSPERR(TSS_E_INTERNAL_ERROR);
}
@@ -1042,6 +1047,7 @@ do_transport_encryption(TPM_TRANSPORT_PUBLIC *transPub,
default:
LogDebug("Unknown algorithm for encrypted transport session: 0x%x",
transPub->algId);
+ free(enc);
return TSPERR(TSS_E_INTERNAL_ERROR);
}
« no previous file with comments | « src/tspi/Makefile.am ('k') | src/tspi/obj_rsakey.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698