Tss2_TctiLdr_FreeInfo(3)

πŸ’– Tss2_TctiLdr_FreeInfo(3) πŸ’–

okay bestie so this is a page from the Library Functions Manual, and today's main character is Tss2_TctiLdr_FreeInfo β€” yes she's a cleanup girlie and honestly? we stan a function that knows how to let go. 🫢


✨ NAME ✨

Tss2_TctiLdr_FreeInfo β€” the function that frees a TSS2_TCTI_INFO structure that got allocated by Tss2_TctiLdr_Initialize(). 🧚


🌸 SYNOPSIS 🌸

#include <tss2/tss2_tctildr.h>

void Tss2_TctiLdr_FreeInfo (TSS2_TCTI_INFO*info);

πŸ’… DESCRIPTION πŸ’…

so basically, Tss2_TctiLdr_FreeInfo() destroys an instance of the TSS2_TCTI_INFO structure that was created by the Tss2_TctiLdr_GetInfo() function. it's giving ✨closure✨, it's giving release the memory back to the universe, no cap.

the info parameter is a reference to the TSS2_TCTI_INFO structure that's about to be freed. that's it. that's the whole job. iconic behaviour honestly. πŸ‘‘


🌈 RETURN VALUE 🌈

this function returns no value. literally nothing. void core. she does her thing and leaves, no notes, no receipt, no drama. πŸ’€


⭐ EXAMPLE ⭐

Example code. (yes bestie, real code, go look πŸ‘€)

#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>

#include <tss2/tss2_tctildr.h>

TSS2_TCTI_INFO *info = NULL;
TSS2_RC rc = Tss2_TctiLdr_GetInfo (NULL, &info);
if (rc != TSS2_RC_SUCCESS) {
    fprintf (stderr, "Failed to get TSS2_TCTI_INFO structure for default "
             "TCTI with response code: 0x%" PRIx32 "0, rc);
    exit (EXIT_FAILURE);
}

if (info != NULL) {
    Tss2_TctiLdr_FreeInfo (info);
    info = NULL;
}

exit (EXIT_SUCCESS);
quick vibe check bestie: see how she checks info != NULL before freeing, and then sets info = NULL right after? that's the self-care. that's the "we don't leave dangling pointers in this house" energy. πŸ”₯

πŸŽ€ AUTHOR πŸŽ€

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


πŸ’œ SEE ALSO πŸ’œ

the whole friend group fr fr, go read them too, iykyk. πŸ¦‹


🌟 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/ β€” share the love, credit the source, slay responsibly πŸ’–


and that's the whole page bestie!! this one's from the TPM2 Software Stack, dated JUNE 2019, and the manual page is Tss2_TctiLdr_FreeInfo(3). free your structs, null your pointers, drink some water, and i'll see u in the next man page πŸ«Άβœ¨πŸ’…

πŸ“¦ where this page comes from