summaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-10-12 21:32:10 +0200
committerYang Tse <yangsita@gmail.com>2011-10-12 21:32:10 +0200
commitbff78cc18e8dc22926d4b0219e6fac08758ed790 (patch)
tree64fd14241294aed026d68aaa92821484965b83b1 /lib/http.c
parent584dc8b8af862f7f47a3a9f02f874ac0bd0076be (diff)
downloadcurl-bff78cc18e8dc22926d4b0219e6fac08758ed790.tar.gz
OOM handling/cleanup slight adjustments
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index ee5d6116a..5b30f8aa0 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1912,8 +1912,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
memcpy(newurl + newlen + (ptr - url),
ptr + currlen, /* copy the trailing zero byte too */
urllen - (ptr-url) - currlen + 1);
- if(data->change.url_alloc)
- free(data->change.url);
+ if(data->change.url_alloc) {
+ Curl_safefree(data->change.url);
+ data->change.url_alloc = FALSE;
+ }
data->change.url = newurl;
data->change.url_alloc = TRUE;
}