struct UrlData *data = conn->data;
+ if(data->proto.generic)
+ free(data->proto.generic);
+ data->proto.generic=NULL; /* it is gone */
+
#ifdef ENABLE_IPV6
if(conn->res) /* host name info */
freeaddrinfo(conn->res);
if(!conn || (conn->handle!= STRUCT_CONNECT)) {
return CURLE_BAD_FUNCTION_ARGUMENT;
}
- if(conn->state != CONN_INIT) {
+ switch(conn->state) {
+ case CONN_INIT:
+ case CONN_DONE:
+ /* these two states are OK */
+ break;
+ default:
+ /* anything else is bad */
return CURLE_BAD_CALLING_ORDER;
}