]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
digest: fix memory leak in auth_create_digest_http_message()
authorhuanghuihui0904 <625173@qq.com>
Mon, 9 Mar 2026 06:39:44 +0000 (14:39 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 9 Mar 2026 08:24:01 +0000 (09:24 +0100)
Signed-off-by: huanghuihui0904 <625173@qq.com>
Closes #20862

lib/vauth/digest.c

index 1bbed7939271226b10f2daef8b14939796f9a009..96093903871fc1215753d6bde0db7ae590b07798 100644 (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);