digest: fix memory leak in auth_create_digest_http_message()

Signed-off-by: huanghuihui0904 <625173@qq.com>

Closes #20862
This commit is contained in:
huanghuihui0904 2026-03-09 14:39:44 +08:00 committed by Daniel Stenberg
parent 4a15bc13f4
commit cbb5544c45
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -809,8 +809,10 @@ static CURLcode auth_create_digest_http_message(
char *hashthis2;
result = hash(hashbuf, (const unsigned char *)"", 0);
if(result)
if(result) {
curlx_free(hashthis);
goto oom;
}
convert_to_ascii(hashbuf, (unsigned char *)hashed);
hashthis2 = curl_maprintf("%s:%s", hashthis, hashed);