Fix double-free of vpninfo->dtls_cipher
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 27 May 2009 08:41:28 +0000 (09:41 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 27 May 2009 08:41:28 +0000 (09:41 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
cstp.c

diff --git a/cstp.c b/cstp.c
index 84fcde8..82cc83c 100644 (file)
--- a/cstp.c
+++ b/cstp.c
@@ -79,6 +79,7 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
        vpninfo->vpn_addr = vpninfo->vpn_netmask = NULL;
        vpninfo->cstp_options = vpninfo->dtls_options = NULL;
        vpninfo->vpn_domain = vpninfo->vpn_proxy_pac = NULL;
+       vpninfo->dtls_cipher = NULL;
 
        for (i=0; i<3; i++)
                vpninfo->vpn_dns[i] = vpninfo->vpn_nbns[i] = NULL;
@@ -276,9 +277,6 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
                }
        }
 
-       free(vpninfo->dtls_cipher);
-       vpninfo->dtls_cipher = NULL;
-
        while (old_dtls_opts) {
                struct vpn_option *tmp = old_dtls_opts;
                old_dtls_opts = old_dtls_opts->next;