From patchwork Sun Aug 9 07:00:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5221 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:21cf:b0:87d:ab56:3700 with SMTP id t15csp1417190mae; Sun, 9 Aug 2026 00:01:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RrE5J1UrBYe0P5Uj1kM4mLBIUlrJUpa5WYxcNaCV4NUeDRX0PN0ji0KyPw4j/cfKH22ScyA29BmPXg=@openvpn.net X-Received: by 2002:a05:6830:3741:b0:7e9:ea28:4c1f with SMTP id 46e09a7af769-7f1e5d893e2mr21720062a34.8.1786258882212; Sun, 09 Aug 2026 00:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786258882; cv=none; d=google.com; s=arc-20260327; b=JSjpj/SLXrmdg4uMSKds84U2F5+mYUcgtmqpCicsiGfs8oAWpShs3a37nYb3h9l3hs QhQhmZIy1me/lZd3PILffQHSptiKyuto0oKBLmRj6HzhdlYwrYpGUnO9zKUqkNtdNu3J h0npfyRp7F83dktRFfRoy8CzJ3Alpc6+p4y3XCVn3nUyXBGKkJWQ2c20jGfLr+dTB3+9 n97duLwWYqJhLeYzkuY8Fi5xYV/BZJYGLMzBgnX/e1P0jM9AXeWqXJOoYIZCJi4SuRhV x4B2EP3hBSSFngNRn+SJkzKCIdG+W3PDIgSdmzAWpelkh9Ta27buzAyQauK7iAaHipVQ lNYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=Fu8Fc5Nwa1yzUegx1W2sKgKwsv82l5bEC6EIUccSdSM=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=fbnLRtAy4hoN62ktFBBQW0adZIEJynMvE2jY3uCbPVIuMpNISdq7T0eETFUevSMNHg apzuDx3iPC2mpHAT1TmRnPDAyTN+AoDxFz8T+A3fFKi/SyDgHhWBlPvne8K4Vz1uPogw eJ572G4u9oMM8CgS2gMc5dI3ccWoTMlbF7IEixhfiwV3uGR763eLpZJrN4JWlnsJyJ1C kkQa6eRuA/Ijajc2NAZ3btotlGxELqYgBdETwxcf543HJenmUVLSKufV2Ayef8CuPBJ2 O2lHdlOyNxV5yTUAxscVKtQz6UgM4ndc/hun2b+n6AKU55b6CDwDX/4DtTbQyBUIhhmt gRWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=aUHAbAlL; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=iHAUhjmS; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=cQkKLiFB; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-7f35b5ac505si5568557a34.36.2026.08.09.00.01.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Aug 2026 00:01:21 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=aUHAbAlL; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=iHAUhjmS; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=cQkKLiFB; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Fu8Fc5Nwa1yzUegx1W2sKgKwsv82l5bEC6EIUccSdSM=; b=aUHAbAlLBveYTgMQ9r1zH1nswE HhqA1mEQZribimHDaLgsEEKxJLjEtoYcUOjznEYlRJd1QSd8djtCbLN4OyHPMaiOs27H4B6+/CUHR sQJIH9H6oPLH9WWDPjchR07EM2ZIsy6stwzd1ZUPl/ka5mO0CQ89njXbX2z82j9o/pBU=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wsxWy-0007Eo-UL; Sun, 09 Aug 2026 07:01:12 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wsxWx-0007Eh-8y for openvpn-devel@lists.sourceforge.net; Sun, 09 Aug 2026 07:01:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gFbqW5Axrp/oyeUSa57l4XuOaPZ2keXhI58fRM+Io6c=; b=iHAUhjmSZYmDNgLopnCbRb/EF6 zUGpllTt/fjBFNMIe44pPFdG3bEzEuuTiiORaDTHgxu400B29ZpNfEUYbmdYnmxvrCKOge0bS6QcN LTBtv2Al54sSJ65H2hEcv4wUflnKkMOwTOOR33PO31EvclB2XwqwHpeeCocqgIoyKjl8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gFbqW5Axrp/oyeUSa57l4XuOaPZ2keXhI58fRM+Io6c=; b=cQkKLiFBBPVNvPPJCDZQPvmW7l Jum7/V8k1w0iXgaD2If7zLFNr5zmpjCrPfuo0pAEHhIhmRFFVQgQH4aUfi+bfEpTnTTq2c+lu0w7l /b1LIGxlxIH2PZG45QKraRQ6pwCGI6vuav2k6YANGbVeSosthMnXGHyn4Hh+IDCujUqg=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wsxWy-0001C9-J0 for openvpn-devel@lists.sourceforge.net; Sun, 09 Aug 2026 07:01:11 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 67971266002394 for ; Sun, 9 Aug 2026 09:01:02 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 679712T2002393 for openvpn-devel@lists.sourceforge.net; Sun, 9 Aug 2026 09:01:02 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 9 Aug 2026 09:00:55 +0200 Message-ID: <20260809070101.2384-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld This code hasn't compiled for years and noone complained. We generally use ASAN instead. So remove the dead code. Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [193.149.48.129 listed in list.dnswl.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1wsxWy-0001C9-J0 Subject: [Openvpn-devel] [PATCH v2] Remove --with-mem-check=dmalloc X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1872879705219109939 X-GMAIL-MSGID: 1873028193899083148 From: Frank Lichtenheld This code hasn't compiled for years and noone complained. We generally use ASAN instead. So remove the dead code. v2: The first version of this change tried to fix the code. v2 instead removes it. Change-Id: I4920318ac537064508eee3ca449d48de76c2ea5d Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe diff --git a/CMakeLists.txt b/CMakeLists.txt index 74c080e..6b3b455 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,7 +260,6 @@ check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_include_files(dlfcn.h HAVE_DLFCN_H) -check_include_files(dmalloc.h HAVE_DMALLOC_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(err.h HAVE_ERR_H) check_include_files(netdb.h HAVE_NETDB_H) diff --git a/config.h.cmake.in b/config.h.cmake.in index 34f289d..c3bb5a5 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -96,9 +96,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DLFCN_H -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_DMALLOC_H - /* Define to 1 if you have the `dup' function. */ #cmakedefine HAVE_DUP diff --git a/configure.ac b/configure.ac index 1aec805..469a475 100644 --- a/configure.ac +++ b/configure.ac @@ -245,10 +245,10 @@ AC_ARG_WITH( [mem-check], - [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|dmalloc|valgrind|ssl @<:@default=no@:>@])], + [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|valgrind|ssl @<:@default=no@:>@])], [ case "${withval}" in - dmalloc|valgrind|ssl|no) ;; + valgrind|ssl|no) ;; *) AC_MSG_ERROR([bad value ${withval} for --mem-check]) ;; esac ], @@ -652,25 +652,6 @@ [AC_MSG_ERROR([valgrind headers not found.])] ) ;; - dmalloc) - AC_CHECK_HEADERS( - [dmalloc.h], - [AC_CHECK_LIB( - [dmalloc], - [malloc], - [ - LIBS="${LIBS} -ldmalloc" - AC_DEFINE( - [DMALLOC], - [1], - [Use dmalloc memory debugging library] - ) - ], - [AC_MSG_ERROR([dmalloc library not found.])] - )], - [AC_MSG_ERROR([dmalloc headers not found.])] - ) - ;; ssl) AC_CHECK_LIB( [ssl], diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index 5f2b233..23d714d 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -57,11 +57,7 @@ } struct buffer -#ifdef DMALLOC -alloc_buf_debug(size_t size, const char *file, int line) -#else alloc_buf(size_t size) -#endif { struct buffer buf; CLEAR(buf); @@ -71,22 +67,14 @@ buf_size_error(size); } buf.capacity = (int)size; -#ifdef DMALLOC - buf.data = openvpn_dmalloc(file, line, size); -#else buf.data = calloc(1, size); -#endif check_malloc_return(buf.data); return buf; } struct buffer -#ifdef DMALLOC -alloc_buf_gc_debug(size_t size, struct gc_arena *gc, const char *file, int line) -#else alloc_buf_gc(size_t size, struct gc_arena *gc) -#endif { struct buffer buf; CLEAR(buf); @@ -96,11 +84,7 @@ buf_size_error(size); } buf.capacity = (int)size; -#ifdef DMALLOC - buf.data = (uint8_t *)gc_malloc_debug(size, false, gc, file, line); -#else buf.data = (uint8_t *)gc_malloc(size, false, gc); -#endif if (size) { *buf.data = 0; @@ -109,7 +93,7 @@ } struct buffer -#ifdef DMALLOC +#ifdef BUF_INIT_TRACKING clone_buf_debug(const struct buffer *buf, const char *file, int line) #else clone_buf(const struct buffer *buf) @@ -123,11 +107,7 @@ ret.debug_file = buf->debug_file; ret.debug_line = buf->debug_line; #endif -#ifdef DMALLOC - ret.data = (uint8_t *)openvpn_dmalloc(file, line, buf->capacity); -#else ret.data = (uint8_t *)malloc(buf->capacity); -#endif check_malloc_return(ret.data); memcpy(BPTR(&ret), BPTR(buf), BLENZ(buf)); return ret; @@ -335,21 +315,13 @@ */ void * -#ifdef DMALLOC -gc_malloc_debug(size_t size, bool clear, struct gc_arena *a, const char *file, int line) -#else gc_malloc(size_t size, bool clear, struct gc_arena *a) -#endif { void *ret; if (a) { struct gc_entry *e; -#ifdef DMALLOC - e = (struct gc_entry *)openvpn_dmalloc(file, line, size + sizeof(struct gc_entry)); -#else e = (struct gc_entry *)malloc(size + sizeof(struct gc_entry)); -#endif check_malloc_return(e); ret = (char *)e + sizeof(struct gc_entry); e->next = a->list; @@ -357,11 +329,7 @@ } else { -#ifdef DMALLOC - ret = openvpn_dmalloc(file, line, size); -#else ret = malloc(size); -#endif check_malloc_return(ret); } #ifndef ZERO_BUFFER_ON_ALLOC @@ -444,11 +412,7 @@ { ASSERT(a); struct gc_entry_special *e; -#ifdef DMALLOC - e = (struct gc_entry_special *)openvpn_dmalloc(file, line, sizeof(struct gc_entry_special)); -#else e = (struct gc_entry_special *)malloc(sizeof(struct gc_entry_special)); -#endif check_malloc_return(e); e->free_fnc = free_function; e->addr = addr; @@ -647,11 +611,7 @@ * Allocate a string */ char * -#ifdef DMALLOC -string_alloc_debug(const char *str, struct gc_arena *gc, const char *file, int line) -#else string_alloc(const char *str, struct gc_arena *gc) -#endif { if (str) { @@ -660,11 +620,7 @@ if (gc) { -#ifdef DMALLOC - ret = (char *)gc_malloc_debug(n, false, gc, file, line); -#else ret = (char *)gc_malloc(n, false, gc); -#endif } else { @@ -672,11 +628,7 @@ * that the caller cleans up afterwards. This is coherent with the * earlier behaviour when gc_malloc() would be called with gc == NULL */ -#ifdef DMALLOC - ret = openvpn_dmalloc(file, line, n); -#else ret = calloc(1, n); -#endif check_malloc_return(ret); } memcpy(ret, str, n); @@ -750,21 +702,13 @@ * Allocate a string inside a buffer */ struct buffer -#ifdef DMALLOC -string_alloc_buf_debug(const char *str, struct gc_arena *gc, const char *file, int line) -#else string_alloc_buf(const char *str, struct gc_arena *gc) -#endif { struct buffer buf; ASSERT(str); -#ifdef DMALLOC - buf_set_read(&buf, (uint8_t *)string_alloc_debug(str, gc, file, line), strlen(str) + 1); -#else buf_set_read(&buf, (uint8_t *)string_alloc(str, gc), strlen(str) + 1); -#endif if (buf.len > 0) /* Don't count trailing '\0' as part of length */ { diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h index 1db9367..22e045c 100644 --- a/src/openvpn/buffer.h +++ b/src/openvpn/buffer.h @@ -147,32 +147,6 @@ void buf_size_error(const size_t size); -/* for dmalloc debugging */ - -#ifdef DMALLOC - -#define alloc_buf(size) alloc_buf_debug(size, __FILE__, __LINE__) -#define alloc_buf_gc(size, gc) alloc_buf_gc_debug(size, gc, __FILE__, __LINE__); -#define clone_buf(buf) clone_buf_debug(buf, __FILE__, __LINE__); -#define gc_malloc(size, clear, arena) gc_malloc_debug(size, clear, arena, __FILE__, __LINE__) -#define string_alloc(str, gc) string_alloc_debug(str, gc, __FILE__, __LINE__) -#define string_alloc_buf(str, gc) string_alloc_buf_debug(str, gc, __FILE__, __LINE__) - -struct buffer alloc_buf_debug(size_t size, const char *file, int line); - -struct buffer alloc_buf_gc_debug(size_t size, struct gc_arena *gc, const char *file, int line); - -struct buffer clone_buf_debug(const struct buffer *buf, const char *file, int line); - -void *gc_malloc_debug(size_t size, bool clear, struct gc_arena *a, const char *file, int line); - -char *string_alloc_debug(const char *str, struct gc_arena *gc, const char *file, int line); - -struct buffer string_alloc_buf_debug(const char *str, struct gc_arena *gc, const char *file, - int line); - -#else /* ifdef DMALLOC */ - struct buffer alloc_buf(size_t size); struct buffer alloc_buf_gc(size_t size, @@ -186,8 +160,6 @@ struct buffer string_alloc_buf(const char *str, struct gc_arena *gc); -#endif /* ifdef DMALLOC */ - void gc_addspecial(void *addr, void (*free_function)(void *), struct gc_arena *a); /** diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h index b602ba1..17085d6 100644 --- a/src/openvpn/crypto_backend.h +++ b/src/openvpn/crypto_backend.h @@ -102,16 +102,6 @@ */ void crypto_unload_provider(const char *provname, provider_t *provider); -#ifdef DMALLOC -/* - * OpenSSL memory debugging. If dmalloc debugging is enabled, tell - * OpenSSL to use our private malloc/realloc/free functions so that - * we can dispatch them to dmalloc. - */ -void crypto_init_dmalloc(void); - -#endif /* DMALLOC */ - void show_available_ciphers(void); void show_available_digests(void); diff --git a/src/openvpn/crypto_mbedtls_legacy.c b/src/openvpn/crypto_mbedtls_legacy.c index debd53d..9e47c26 100644 --- a/src/openvpn/crypto_mbedtls_legacy.c +++ b/src/openvpn/crypto_mbedtls_legacy.c @@ -139,14 +139,6 @@ } -#ifdef DMALLOC -void -crypto_init_dmalloc(void) -{ - msg(M_ERR, "Error: dmalloc support is not available for mbed TLS."); -} -#endif /* DMALLOC */ - const cipher_name_pair cipher_name_translation_table[] = { { "BF-CBC", "BLOWFISH-CBC" }, { "BF-CFB", "BLOWFISH-CFB64" }, diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index fa9eb67..1191f20 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -39,6 +39,7 @@ #include "integer.h" #include "crypto.h" #include "crypto_backend.h" +#include "memdbg.h" #include "openssl_compat.h" #include @@ -273,40 +274,6 @@ } -/* - * - * OpenSSL memory debugging. If dmalloc debugging is enabled, tell - * OpenSSL to use our private malloc/realloc/free functions so that - * we can dispatch them to dmalloc. - * - */ - -#ifdef DMALLOC -static void * -crypto_malloc(size_t size, const char *file, int line) -{ - return dmalloc_malloc(file, line, size, DMALLOC_FUNC_MALLOC, 0, 0); -} - -static void * -crypto_realloc(void *ptr, size_t size, const char *file, int line) -{ - return dmalloc_realloc(file, line, ptr, size, DMALLOC_FUNC_REALLOC, 0); -} - -static void -crypto_free(void *ptr) -{ - dmalloc_free(__FILE__, __LINE__, ptr, DMALLOC_FUNC_FREE); -} - -void -crypto_init_dmalloc(void) -{ - CRYPTO_set_mem_ex_functions(crypto_malloc, crypto_realloc, crypto_free); -} -#endif /* DMALLOC */ - const cipher_name_pair cipher_name_translation_table[] = { { "AES-128-GCM", "id-aes128-GCM" }, { "AES-192-GCM", "id-aes192-GCM" }, diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 0236886..893670f 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -838,11 +838,6 @@ bool init_static(void) { -#if defined(DMALLOC) - crypto_init_dmalloc(); -#endif - - /* * Initialize random number seed. random() is only used * when "weak" random numbers are acceptable. diff --git a/src/openvpn/memdbg.h b/src/openvpn/memdbg.h index ea620c2..1f94582 100644 --- a/src/openvpn/memdbg.h +++ b/src/openvpn/memdbg.h @@ -43,67 +43,10 @@ */ #ifdef USE_VALGRIND - #include - -#define VALGRIND_MAKE_READABLE(addr, len) - -#else /* ifdef USE_VALGRIND */ - -#define VALGRIND_MAKE_READABLE(addr, len) - #endif -#ifdef DMALLOC /* see ./configure options to enable */ - -/* - * See ./configure options to enable dmalloc - * support for memory leak checking. - * - * The dmalloc package can be downloaded from: - * - * https://dmalloc.com/ - * - * When dmalloc is installed and enabled, - * use this command prior to running openvpn: - * - * dmalloc -l dlog -i 100 low -p log-unknown - * - * Also, put this in your .bashrc file: - * - * function dmalloc { eval `command dmalloc -b $*`; } - * - * Or take a more low-level approach: - * - * export DMALLOC_OPTIONS="debug=0x4e48503,inter=100,log=dlog" - * - * NOTE: When building dmalloc you need to add something - * like this to dmalloc's settings.h -- it will allocate a static - * buffer to be used as the malloc arena: - * - * #define INTERNAL_MEMORY_SPACE (1024 * 1024 * 50) - */ - -#include - -#define openvpn_dmalloc(file, line, size) \ - dmalloc_malloc((file), (line), (size), DMALLOC_FUNC_MALLOC, 0, 0) - -/* - * This #define will put the line number of the log - * file position where leaked memory was allocated instead - * of the source code file and line number. Make sure - * to increase the size of dmalloc's info tables, - * (MEMORY_TABLE_SIZE in settings.h) - * otherwise it might get overwhelmed by the large - * number of unique file/line combinations. - */ -#if 0 -#undef malloc -#define malloc(size) openvpn_dmalloc("logfile", x_msg_line_num, (size)) -#endif - -#endif /* DMALLOC */ +#define VALGRIND_MAKE_READABLE(addr, len) /* * Force buffers to be zeroed after allocation.