]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
memory: stop overriding unused `wcsdup()`/`_wcsdup()` system functions
authorViktor Szakats <commit@vsz.me>
Mon, 7 Jul 2025 09:46:26 +0000 (11:46 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 7 Jul 2025 13:03:31 +0000 (15:03 +0200)
Also ban them via `checksrc`.

The code continues to use `_tcsdup()`.

Assisted-by: Daniel Stenberg
Closes #17840

lib/curl_memory.h
lib/memdebug.h
scripts/checksrc.pl

index df64786e8a94df111f6102022166eff61eb75426..41933d6af9815845a5ccdd0385adef287397b39f 100644 (file)
@@ -69,8 +69,6 @@
 
 #ifdef _WIN32
 #  ifdef UNICODE
-#    undef wcsdup
-#    undef _wcsdup
 #    undef _tcsdup
 #  else
 #    undef _tcsdup
@@ -155,10 +153,6 @@ extern curl_wcsdup_callback Curl_cwcsdup;
 
 #ifdef _WIN32
 #  ifdef UNICODE
-#    undef wcsdup
-#    define wcsdup(ptr) Curl_cwcsdup(ptr)
-#    undef _wcsdup
-#    define _wcsdup(ptr) Curl_cwcsdup(ptr)
 #    undef _tcsdup
 #    define _tcsdup(ptr) Curl_cwcsdup(ptr)
 #  else
index 2038dc34d396f26b5bf8c056c96d514e18e116ea..e109e0b20a9100d2ccfc5edcf21eb36fcd6b4cfc 100644 (file)
@@ -142,10 +142,6 @@ CURL_EXTERN ALLOC_FUNC
 
 #ifdef _WIN32
 #  ifdef UNICODE
-#    undef wcsdup
-#    define wcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
-#    undef _wcsdup
-#    define _wcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
 #    undef _tcsdup
 #    define _tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
 #  else
index 47ea1cf54af7cd982890971804ef4bbd76d55620..8dbb3f384eaa3f5713f8c3fb850e34c6c090f7b6 100755 (executable)
@@ -65,6 +65,8 @@ my %banfunc = (
     "_tcsncat" => 1,
     "_wcscat" => 1,
     "_wcsncat" => 1,
+    "_wcsdup" => 1,
+    "wcsdup" => 1,
     "LoadLibrary" => 1,
     "LoadLibraryA" => 1,
     "LoadLibraryW" => 1,