src: safely clear certain buffers

Credits-to: Daniel Gustafsson
Ref: #13589 (original attempt)

Follow-up to 066478f634 #21598

safe clear more password buffers

tool_cfgable.c more

drop using dropped wrappers

creds.h copy comment suggested by LLM
This commit is contained in:
Viktor Szakats 2026-05-14 01:36:22 +02:00
parent 70666b9be8
commit f600501916
No known key found for this signature in database
9 changed files with 37 additions and 4 deletions

View file

@ -154,6 +154,7 @@ static CURLcode setstropt_userpwd(const char *option, char **userp,
curlx_free(*userp);
*userp = user;
curlx_strzero(*passwdp);
curlx_free(*passwdp);
*passwdp = passwd;
@ -1657,6 +1658,7 @@ static CURLcode setopt_cptr_proxy(struct Curl_easy *data, CURLoption option,
result = Curl_urldecode(p, 0, &s->str[STRING_PROXYPASSWORD], NULL,
REJECT_ZERO);
curlx_free(u);
curlx_strzero(p);
curlx_free(p);
break;
}