From a9b6b91932c8fd3d028c672dc011c6e373c1bcdf Mon Sep 17 00:00:00 2001 From: CharlieYJH Date: Wed, 10 May 2023 18:28:59 -0700 Subject: [PATCH] Fix memory leaks from Esys_CreatePrimary Signed-off-by: CharlieYJH --- src/lib/tpm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/tpm.c b/src/lib/tpm.c index a51b8ad4..009f831c 100644 --- a/src/lib/tpm.c +++ b/src/lib/tpm.c @@ -4408,6 +4408,11 @@ WEAK CK_RV tpm_create_transient_primary_from_template(tpm_ctx *tpm, return CKR_GENERAL_ERROR; } + Esys_Free(data); + Esys_Free(hash); + Esys_Free(ticket); + Esys_Free(out_pub); + *primary_handle = handle; return CKR_OK;