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
9 * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
14 @file der_sequence_free.c
15 ASN.1 DER, free's a structure allocated by der_decode_sequence_flexi(), Tom St Denis
21 Free memory allocated by der_decode_sequence_flexi()
22 @param in The list to free
24 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);
49 case LTC_ASN1_SEQUENCE: break;
50 case LTC_ASN1_INTEGER : if (in->data != NULL) { mp_clear(in->data); } break;
51 default : if (in->data != NULL) { XFREE(in->data); }
54 /* move to next and free current */
63 /* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_free.c,v $ */
64 /* $Revision: 1.3 $ */
65 /* $Date: 2006/03/31 14:15:35 $ */