]> granicus.if.org Git - curl/commitdiff
memory leak adjusts
authorDaniel Stenberg <daniel@haxx.se>
Wed, 11 Oct 2000 10:29:25 +0000 (10:29 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 11 Oct 2000 10:29:25 +0000 (10:29 +0000)
lib/highlevel.c
lib/http.c
lib/urldata.h

index b290d9ff6d2411c0fcddd9eb4045a13b09344aaf..add9735b88ffc1fa62e63ddaf71e3f38ba62072a 100644 (file)
@@ -722,6 +722,7 @@ CURLcode curl_transfer(CURL *curl)
         /* TBD: set the URL with curl_setopt() */
         data->url = data->newurl;
         data->newurl = NULL; /* don't show! */
+        data->bits.urlstringalloc = TRUE; /* the URL is allocated */
 
         /* Disable both types of POSTs, since doing a second POST when
            following isn't what anyone would want! */
index 6c247792c4ec4901b14473ed4bb0367d88c8cdaf..551fac3397184862deb7890773ae580cc513829c 100644 (file)
@@ -254,7 +254,8 @@ CURLcode http_done(struct connectdata *conn)
     *bytecount = http->readbytecount + http->writebytecount;
   }
 
-  /* TBD: the HTTP struct remains allocated here */
+  free(http);
+  data->proto.http=NULL; /* it is gone */
 
   return CURLE_OK;
 }
index 87e49a84052d598ea7b9f924656eb443cae98a91..e5fcf16ff4bcc4e5688eb94f3c1ee2235f7a00e2 100644 (file)
@@ -304,16 +304,18 @@ struct Configbits {
   bool mute;
   bool no_body;
   bool proxy_user_passwd;
-  bool proxystringalloc; /* the http proxy string is malloc()'ed */
   bool set_port;
   bool set_range;
-  bool rangestringalloc; /* the range string is malloc()'ed */
   bool upload;
   bool use_netrc;
   bool user_passwd;
   bool verbose;
   bool this_is_a_follow; /* this is a followed Location: request */
   bool krb4; /* kerberos4 connection requested */
+
+  bool proxystringalloc; /* the http proxy string is malloc()'ed */
+  bool rangestringalloc; /* the range string is malloc()'ed */
+  bool urlstringalloc;   /* the URL string is malloc()'ed */
 };
 
 /* What type of interface that intiated this struct */