Skip to content
Permalink
Browse files
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 97d68d9312dfc4a4f584719c9b8627734d79225c
Showing with 6 additions and 3 deletions.
  1. +6 −3 main.c
9 main.c
@@ -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;
@@ -760,12 +760,15 @@ 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"));

0 comments on commit 97d68d9

Please sign in to comment.