Function esp_idf_svc::sys::mbedtls_asn1_sequence_free
source ยท pub unsafe extern "C" fn mbedtls_asn1_sequence_free(
seq: *mut mbedtls_asn1_sequence,
)
Expand description
\brief Free a heap-allocated linked list presentation of an ASN.1 sequence, including the first element.
There are two common ways to manage the memory used for the representation of a parsed ASN.1 sequence:
- Allocate a head node
mbedtls_asn1_sequence *head
with mbedtls_calloc(). Pass this node as thecur
argument to mbedtls_asn1_get_sequence_of(). When you have finished processing the sequence, call mbedtls_asn1_sequence_free() onhead
. - Allocate a head node
mbedtls_asn1_sequence *head
in any manner, for example on the stack. Make sure thathead->next == NULL
. Passhead
as thecur
argument to mbedtls_asn1_get_sequence_of(). When you have finished processing the sequence, call mbedtls_asn1_sequence_free() onhead->cur
, then freehead
itself in the appropriate manner.
\param seq The address of the first sequence component. This may be \c NULL, in which case this functions returns immediately.