1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
12 @file der_sequence_free.c
13 ASN.1 DER, free's a structure allocated by der_decode_sequence_flexi(), Tom St Denis
19 Free memory allocated by der_decode_sequence_flexi()
20 @param in The list to free
22 void der_sequence_free(ltc_asn1_list *in)
28 /* walk to the start of the chain */
29 while (in->prev != NULL || in->parent != NULL) {
30 if (in->parent != NULL) {
37 /* now walk the list and free stuff */
39 /* is there a child? */
42 in->child->parent = NULL;
43 der_sequence_free(in->child);
47 case LTC_ASN1_SETOF: break;
48 case LTC_ASN1_INTEGER : if (in->data != NULL) { mp_clear(in->data); } break;
49 default : if (in->data != NULL) { XFREE(in->data); }
52 /* move to next and free current */
61 /* ref: $Format:%D$ */
62 /* git commit: $Format:%H$ */
63 /* commit time: $Format:%ai$ */