Skip to content

Commit

Permalink
Fix various bugs in split_{in,ex}clude list handling
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed May 2, 2009
1 parent 8bc6edf commit 275cb2c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cstp.c
Expand Up @@ -83,16 +83,17 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
for (i=0; i<3; i++)
vpninfo->vpn_dns[i] = vpninfo->vpn_nbns[i] = NULL;

for (inc = vpninfo->split_includes; inc; inc = inc->next) {
for (inc = vpninfo->split_includes; inc; ) {
struct split_include *next = inc->next;
free(inc);
inc = next;
}
for (inc = vpninfo->split_excludes; inc; inc = inc->next) {
for (inc = vpninfo->split_excludes; inc; ) {
struct split_include *next = inc->next;
free(inc);
inc = next;
}
vpninfo->split_includes = vpninfo->split_excludes = NULL;
retry:
openconnect_SSL_printf(vpninfo->https_ssl, "CONNECT /CSCOSSLC/tunnel HTTP/1.1\r\n");
openconnect_SSL_printf(vpninfo->https_ssl, "Host: %s\r\n", vpninfo->hostname);
Expand Down Expand Up @@ -249,7 +250,7 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
if (!exc)
continue;
exc->route = new_option->value;
exc->next = vpninfo->split_includes;
exc->next = vpninfo->split_excludes;
vpninfo->split_excludes = exc;
}
}
Expand Down

0 comments on commit 275cb2c

Please sign in to comment.