mirror of
https://github.com/curl/curl.git
synced 2026-08-26 18:53:33 +03:00
url: make parse_login_details use memdup0
Also make the user and password arguments mandatory, since all code paths in libcurl used them anyway. Adapted unit test case 1620 to the new rules. Closes #13584
This commit is contained in:
parent
fa9a564942
commit
0e37b42dc9
2 changed files with 42 additions and 61 deletions
|
|
@ -46,6 +46,8 @@ UNITTEST_START
|
|||
struct Curl_easy *empty;
|
||||
const char *hostname = "hostname";
|
||||
enum dupstring i;
|
||||
char *userstr = NULL;
|
||||
char *passwdstr = NULL;
|
||||
|
||||
bool async = FALSE;
|
||||
bool protocol_connect = FALSE;
|
||||
|
|
@ -73,10 +75,12 @@ UNITTEST_START
|
|||
rc = Curl_init_do(empty, empty->conn);
|
||||
fail_unless(rc == CURLE_OK, "Curl_init_do() failed");
|
||||
|
||||
rc = Curl_parse_login_details(
|
||||
hostname, strlen(hostname), NULL, NULL, NULL);
|
||||
rc = Curl_parse_login_details(hostname, strlen(hostname),
|
||||
&userstr, &passwdstr, NULL);
|
||||
fail_unless(rc == CURLE_OK,
|
||||
"Curl_parse_login_details() failed");
|
||||
free(userstr);
|
||||
free(passwdstr);
|
||||
|
||||
Curl_freeset(empty);
|
||||
for(i = (enum dupstring)0; i < STRING_LAST; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue