ASN1: Fix NULL pointer dereference on stack allocation failure.
authorKp <kp@valhallalegends.com>
Sat, 31 May 2008 04:31:07 +0000 (23:31 -0500)
committerKp <kp@valhallalegends.com>
Mon, 1 Sep 2008 19:52:21 +0000 (14:52 -0500)
commit8a03227a106d087077ab9f9e21f644c8b653af3f
treec08866a987710d17aae688723a352550fa79ac9c
parent7f51164d1ac93077d832de44a8dc71783fab8b33
ASN1: Fix NULL pointer dereference on stack allocation failure.

If the second silc_stack_alloc fails, then asn1->stack2 is NULL.  Thus,
when silc_asn1_init calls silc_stack_free(asn1->stack2), it is
equivalent to silc_stack_free(NULL).  However, silc_stack_free does not
check for a NULL pointer.  Fix silc_asn1_init to free asn1->stack1, as
was intended.
lib/silcasn1/silcasn1.c