hostip: bad CURLOPT_RESOLVE syntax now returns error

Added test 3019
Fixes #7170
Closes #7174
This commit is contained in:
Alexis Vachette 2021-06-02 14:12:10 +02:00 committed by Daniel Stenberg
parent 002f976cdc
commit cb39b4b7c4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 41 additions and 3 deletions

View file

@ -1104,10 +1104,10 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
error = false;
err:
if(error) {
infof(data, "Couldn't parse CURLOPT_RESOLVE entry '%s'!\n",
failf(data, "Couldn't parse CURLOPT_RESOLVE entry '%s'!",
hostp->data);
Curl_freeaddrinfo(head);
continue;
return CURLE_SETOPT_OPTION_SYNTAX;
}
/* Create an entry id, based upon the hostname and port */