Skip to content

Commit

Permalink
Fix potential leak of 'domains' in parse_fortinet_xml_config()
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed Apr 28, 2021
1 parent bea215b commit 786b420
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fortinet.c
Expand Up @@ -474,7 +474,6 @@ static int parse_fortinet_xml_config(struct openconnect_info *vpninfo, char *buf
domains->data[domains->pos-1] = '\0';
new_ip_info.domain = add_option_steal(&new_opts, "search", &domains->data);
}
buf_free(domains);

ret = install_vpn_opts(vpninfo, new_opts, &new_ip_info);
if (ret) {
Expand All @@ -488,8 +487,10 @@ static int parse_fortinet_xml_config(struct openconnect_info *vpninfo, char *buf
}
out:
xmlFreeDoc(xml_doc);
buf_free(domains);
free(s);
free(s2);

return ret;
}

Expand Down

0 comments on commit 786b420

Please sign in to comment.