corrected delete_unneeded_choice_fields().
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 14 Mar 2014 14:27:21 +0000 (15:27 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 14 Mar 2014 14:27:21 +0000 (15:27 +0100)
lib/decoding.c

index 82f1c24..dee7a9f 100644 (file)
@@ -813,9 +813,12 @@ _asn1_get_indefinite_length_string (const unsigned char *der, int *len)
 
 static void delete_unneeded_choice_fields(asn1_node p)
 {
-  if (p->right)
+  asn1_node p2;
+
+  while (p->right)
     {
-      asn1_delete_structure (&p->right);
+      p2 = p->right;
+      asn1_delete_structure (&p2);
     }
 }