setopt: setting PROXYUSERPWD after PROXYUSERNAME/PASSWORD is fine

Prevent the previous memory leak. Adjusted test 590 to reproduce the
problem then verify the fix.

Fixes #16599
Reported-by: Catena cyber
Closes #16601
This commit is contained in:
Daniel Stenberg 2025-03-06 23:40:17 +01:00
parent f1662ae97b
commit 4e8d621bd8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 10 additions and 2 deletions

View file

@ -61,6 +61,10 @@ CURLcode test(char *URL)
test_setopt(curl, CURLOPT_PROXYAUTH,
(long) (CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM));
test_setopt(curl, CURLOPT_PROXY, libtest_arg2); /* set in first.c */
/* set the name + password twice to test that the API is fine with it */
test_setopt(curl, CURLOPT_PROXYUSERNAME, "me");
test_setopt(curl, CURLOPT_PROXYPASSWORD, "password");
test_setopt(curl, CURLOPT_PROXYUSERPWD, "me:password");
res = curl_easy_perform(curl);