to not have to modify everything at once, we allocate a temporary
connection data struct and fill in for comparison purposes. */
- conn = (struct connectdata *)malloc(sizeof(struct connectdata));
+ conn = (struct connectdata *)calloc(sizeof(struct connectdata), 1);
if(!conn) {
*in_connect = NULL; /* clear the pointer */
return CURLE_OUT_OF_MEMORY;
any failure */
*in_connect = conn;
- /* we have to init the struct */
- memset(conn, 0, sizeof(struct connectdata));
-
/* and we setup a few fields in case we end up actually using this struct */
conn->data = data; /* remember our daddy */
conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
if(NULL == conn->host.rawalloc)
return CURLE_OUT_OF_MEMORY;
conn->host.name = conn->host.rawalloc;
+ conn->host.name[0] = 0;
/*************************************************************
* Parse the URL.