Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make authentication valgrind-friendly
Not strictly needed to free stuff right before we exit, but it makes it
easier to find leaks in the library code.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 12, 2012
1 parent cc6957a commit 97d68d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.c
Expand Up @@ -537,13 +537,13 @@ int main(int argc, char **argv)
vpninfo->cookie = keep_config_arg();
break;
case 'c':
vpninfo->cert = keep_config_arg();
vpninfo->cert = strdup(config_arg);
break;
case 'e':
vpninfo->cert_expire_warning = 86400 * atoi(config_arg);
break;
case 'k':
vpninfo->sslkey = keep_config_arg();
vpninfo->sslkey = strdup(config_arg);
break;
case 'd':
vpninfo->deflate = 1;
Expand Down Expand Up @@ -760,13 +760,16 @@ int main(int argc, char **argv)
openconnect_get_cert_sha1(vpninfo, vpninfo->peer_cert, buf);
printf("FINGERPRINT='%s'\n", buf);
}
openconnect_vpninfo_free(vpninfo);
exit(0);
} else if (cookieonly) {
printf("%s\n", vpninfo->cookie);
if (cookieonly == 1)
if (cookieonly == 1) {
/* We use cookieonly=2 for 'print it and continue' */
openconnect_vpninfo_free(vpninfo);
exit(0);
}
}
if (make_cstp_connection(vpninfo)) {
fprintf(stderr, _("Creating SSL connection failed\n"));
exit(1);
Expand Down

0 comments on commit 97d68d9

Please sign in to comment.