void silc_asn1_uninit(SilcAsn1 asn1)
{
+ SilcStack stack1 = asn1->stack1;
+
+ if (asn1->switched) {
+ stack1 = asn1->stack2;
+ asn1->stack2 = asn1->stack1;
+ }
+
silc_stack_free(asn1->stack2);
- silc_stack_free(asn1->stack1);
+ silc_stack_free(stack1);
}
#if defined(SILC_DEBUG)
stack1 = asn1->stack1;
asn1->stack1 = asn1->stack2;
asn1->stack2 = stack1;
+ asn1->switched = !asn1->switched;
}
}
SilcStack stack2; /* Internal stack for encoding/decoding */
va_list ap; /* List of ASN.1 types given as argument */
unsigned int accumul : 1; /* Accumulate memory from stack for result */
+ unsigned int switched : 1; /* Set when stack2 is set to stack1 */
};
/* The maximum depth for recursion in encoder and decoder. */