]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/server: drop pointless memory allocation overrides
authorViktor Szakats <commit@vsz.me>
Wed, 8 Oct 2025 01:09:23 +0000 (03:09 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 8 Oct 2025 10:53:49 +0000 (12:53 +0200)
The code was overriding system memory allocation functions to a local
jump table (declared in `curl_setup.h`). And setup that jump table
to call the original system allocation functions.

Also tested fine with cegcc/WinCE. The `_strdup` fallback was possibly
required for an MSVC WinCE toolchain.

Closes #18922

tests/server/Makefile.inc
tests/server/memptr.c [deleted file]

index bbdacc1a17b9d6758406c8a70e69b8510ea19b6d..c335e885b255be6516a2a3967c0a0d065ddfa9ff 100644 (file)
@@ -30,7 +30,7 @@ FIRST_C = first.c
 FIRST_H = first.h
 
 # Common files used by test programs
-UTILS_C = memptr.c getpart.c util.c
+UTILS_C = getpart.c util.c
 UTILS_H =
 
 CURLX_C = \
diff --git a/tests/server/memptr.c b/tests/server/memptr.c
deleted file mode 100644 (file)
index 247bbf1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at https://curl.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * SPDX-License-Identifier: curl
- *
- ***************************************************************************/
-#include "first.h"
-
-#include "curl_memory.h"
-
-#ifdef UNDER_CE
-#define system_strdup _strdup
-#else
-#define system_strdup strdup
-#endif
-
-#if defined(_MSC_VER) && defined(_DLL)
-#  pragma warning(push)
-#  pragma warning(disable:4232) /* MSVC extension, dllimport identity */
-#endif
-
-curl_malloc_callback Curl_cmalloc = (curl_malloc_callback)malloc;
-curl_free_callback Curl_cfree = (curl_free_callback)free;
-curl_realloc_callback Curl_crealloc = (curl_realloc_callback)realloc;
-curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)system_strdup;
-curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc;
-
-#if defined(_MSC_VER) && defined(_DLL)
-#  pragma warning(pop)
-#endif