From 1ae753e4240434abda0a33aed07b289fa9c6ee79 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Tue, 4 Jun 2024 23:17:08 +0200 Subject: [PATCH] LZO: do not use lzoutils.h macros Instead of lzo_{free,malloc} we can just use the free and malloc as the lzoutils.h header itself suggests. Change-Id: I32ee28fde5d38d736f753c782d88a81de7fe2980 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Message-Id: <20240604211708.32315-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28705.html Signed-off-by: Gert Doering (cherry picked from commit d601237976323b5d8f6ac65c27ccc510563ad75f) --- config.h.cmake.in | 3 --- configure.ac | 9 --------- src/openvpn/lzo.c | 4 ++-- src/openvpn/lzo.h | 9 ++------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/config.h.cmake.in b/config.h.cmake.in index 7021310ab..e0abdb0a1 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -181,9 +181,6 @@ don't. */ /* Define to 1 if you have the header file. */ #define HAVE_LZO1X_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_LZOUTIL_H 1 - /* Define to 1 if you have the `mlockall' function. */ #cmakedefine HAVE_MLOCKALL diff --git a/configure.ac b/configure.ac index 1619b4340..f56d0ccf5 100644 --- a/configure.ac +++ b/configure.ac @@ -1169,15 +1169,6 @@ fi if test "${have_lzo}" = "yes"; then saved_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${LZO_CFLAGS}" - AC_CHECK_HEADERS( - [lzo/lzoutil.h], - , - [AC_CHECK_HEADERS( - [lzoutil.h], - , - [AC_MSG_ERROR([lzoutil.h is missing])] - )] - ) AC_CHECK_HEADERS( [lzo/lzo1x.h], , diff --git a/src/openvpn/lzo.c b/src/openvpn/lzo.c index b313284df..bab2d7828 100644 --- a/src/openvpn/lzo.c +++ b/src/openvpn/lzo.c @@ -107,14 +107,14 @@ lzo_compress_init(struct compress_context *compctx) { msg(M_FATAL, "Cannot initialize LZO compression library (lzo_init() returns %d)", lzo_status); } - compctx->wu.lzo.wmem = (lzo_voidp) lzo_malloc(compctx->wu.lzo.wmem_size); + compctx->wu.lzo.wmem = (lzo_voidp) malloc(compctx->wu.lzo.wmem_size); check_malloc_return(compctx->wu.lzo.wmem); } static void lzo_compress_uninit(struct compress_context *compctx) { - lzo_free(compctx->wu.lzo.wmem); + free(compctx->wu.lzo.wmem); compctx->wu.lzo.wmem = NULL; } diff --git a/src/openvpn/lzo.h b/src/openvpn/lzo.h index e951b49bb..62d73a1b3 100644 --- a/src/openvpn/lzo.h +++ b/src/openvpn/lzo.h @@ -40,16 +40,11 @@ #if defined(HAVE_LZO_CONF_H) /* The lzo.h magic gets confused and still wants * to include lzo/lzoconf.h even if our include paths - * are setup to include the paths without lzo/ include lzoconf.h to - * avoid it being include by lzoutil.h */ + * are setup to include the paths without lzo/ + */ #include #include #endif -#if defined(HAVE_LZO_LZOUTIL_H) -#include -#elif defined(HAVE_LZOUTIL_H) -#include -#endif #if defined(HAVE_LZO_LZO1X_H) #include #elif defined(HAVE_LZO1X_H) -- 2.47.3