]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ldap: fix to not leak `attribute` on OOM (WinLDAP)
authorViktor Szakats <commit@vsz.me>
Tue, 12 May 2026 16:19:26 +0000 (18:19 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 12 May 2026 22:43:27 +0000 (00:43 +0200)
Reported-by: Andrew Nesbitt
Closes #21576

lib/ldap.c

index f476da4ea00d8f7ad441bfcb2046c008f5705613..0f9e7821719bd36ceb27f87d560abfa4e2ed5080 100644 (file)
@@ -474,6 +474,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
 #ifdef USE_WIN32_LDAP
       char *attr = curlx_convert_tchar_to_UTF8(attribute);
       if(!attr) {
+        ldap_memfree(attribute);
         result = CURLE_OUT_OF_MEMORY;
         goto quit;
       }