---
name: "Tss2_TctiLdr_Finalize"
section: "3"
platform: "linux"
package: "tpm2-tss"
version: "4.2.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Tss2_TctiLdr_Finalize"
---

# Tss2\_TctiLdr\_Finalize(3)

Function to finalize a TCTI context instantiated by the Tss2\_TctiLdr\_Initialize function.

## NAME

Tss2\_TctiLdr\_Finalize - Function to finalize a TCTI context instantiated by the Tss2\_TctiLdr\_Initialize function.

## SYNOPSIS

**#include \<tss2/tss2\_tctildr.h\>**

**TSS2\_RC Tss2\_TctiLdr\_Finalize (TSS2\_TCTI\_CONTEXT** *\*\*CONTEXT***);**

## DESCRIPTION

The **Tss2\_TctiLdr\_Finalize**() function destroys an instance of a TCTI context instantiated by the **Tss2\_TctLdr\_Initialize**() function. It also frees any resources associated with loading the required TCTI library.

The *context* parameter is a double pointer to a TCTI context. When successfully finalized the provided reference will be set to NULL by the function.

## RETURN VALUE

This function returns no value.

## EXAMPLE

Example code.

```
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <tss2/tss2_tctildr.h>
TSS2_TCTI_CONTEXT *ctx = NULL;
TSS2_RC rc = Tss2_TctiLdr_Initialize (NULL, NULL, &ctx);
if (rc != TSS2_RC_SUCCESS) {
    fprintf (stderr, "Initialization of default TCTI context failed with "
             "response code: 0x%" PRIx32 "0, rc);
    exit (EXIT_FAILURE);
}
if (ctx != NULL)
    Tss2_TctiLdr_Finalize (&ctx);
exit (EXIT_SUCCESS);
```

## AUTHOR

TPM2 Software Project \<https://github.com/tpm2-software/tpm2-tss\>

## SEE ALSO

[**Tss2\_Tcti\_Device\_Init**(3)](/Tss2_Tcti_Device_Init/3.md), **Tss2\_Tcti\_Socket\_Init**(3), [**Tss2\_TctiLdr\_Initialize**(3)](/Tss2_TctiLdr_Initialize/3.md), [**Tss2\_TctiLdr\_Finalize**(3)](/Tss2_TctiLdr_Finalize/3.md), **tcti-device**(7), **tcti-socket**(7), **tcti-tabrmd**(7), [**tpm2-abrmd**(8)](/tpm2-abrmd/8.md)

## COLOPHON

This page is part of release 4.2.0 of Open Source implementation of the TCG TPM2 Software Stack (TSS2). A description of the project, information about reporting bugs, and the latest version of this page can be found at https://github.com/tpm2-software/tpm2-tss/.

## LICENSE

This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). For more information visit https://creativecommons.org/licenses/by/4.0/
