Fix leak of form_buf on redirect/repost/etc
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 24 Nov 2010 23:45:49 +0000 (23:45 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 24 Nov 2010 23:45:49 +0000 (23:45 +0000)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
http.c

diff --git a/http.c b/http.c
index 6de520b..89f1e41 100644 (file)
--- a/http.c
+++ b/http.c
@@ -599,6 +599,10 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
        char *method = "GET";
 
  retry:
+       if (form_buf) {
+               free(form_buf);
+               form_buf = NULL;
+       }
        if (!vpninfo->https_ssl && openconnect_open_https(vpninfo)) {
                vpninfo->progress(vpninfo, PRG_ERR, "Failed to open HTTPS connection to %s\n",
                        vpninfo->hostname);