aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index b32ca1d5b..7c63097c9 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1894,13 +1894,16 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
the rest of the request in the PERFORM phase. */
*done = TRUE;
+ /* If there already is a protocol-specific struct allocated for this
+ sessionhandle, deal with it */
+ Curl_reset_reqproto(conn);
+
if(!data->reqdata.proto.http) {
/* Only allocate this struct if we don't already have it! */
- http = (struct HTTP *)malloc(sizeof(struct HTTP));
+ http = (struct HTTP *)calloc(sizeof(struct HTTP), 1);
if(!http)
return CURLE_OUT_OF_MEMORY;
- memset(http, 0, sizeof(struct HTTP));
data->reqdata.proto.http = http;
}
else