From 594c92ed50c26db1f94b7ea489040640a9eda7dc Mon Sep 17 00:00:00 2001 From: Julien Barbot Date: Wed, 1 Apr 2020 16:31:53 +0200 Subject: [PATCH] Do not process tag with no children */ + if (max_choices == 0) { + return 0; + } + opt = calloc(1, sizeof(*opt)); if (!opt) return -ENOMEM; @@ -98,8 +106,6 @@ static int parse_auth_choice(struct openconnect_info *vpninfo, struct oc_auth_fo return -EINVAL; } - for (opt_node = xml_node->children; opt_node; opt_node = opt_node->next) - max_choices++; opt->choices = calloc(1, max_choices * sizeof(struct oc_choice *)); if (!opt->choices) { -- GitLab