Skip to content

Commit

Permalink
TCTI: Fix leak produced in Tss2_TctiLdr_Initialize_Ex
Browse files Browse the repository at this point in the history
The return code of tctildr_init_context_data was not checked in
Tss2_TctiLdr_Initialize_Ex. The cleanup part of this function was
not executed and so a leak was produced.
Fixes tpm2-software#2842

Signed-off-by: Juergen Repp <juergen_repp@web.de>
  • Loading branch information
JuergenReppSIT committed May 19, 2024
1 parent fc98757 commit e625875
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tss2-tcti/tctildr.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ Tss2_TctiLdr_Initialize_Ex (const char *name,
}

*tctiContext = (TSS2_TCTI_CONTEXT *) ldr_ctx;
return tctildr_init_context_data(*tctiContext, local_name, local_conf);
rc = tctildr_init_context_data(*tctiContext, local_name, local_conf);
if (rc == TSS2_RC_SUCCESS) {
return rc;
}

err:
if (*tctiContext != NULL) {
Expand Down

0 comments on commit e625875

Please sign in to comment.