From 932357a6aee49690fb557016793b428d9696254b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Mon, 7 Aug 2023 10:31:44 +0200 Subject: [PATCH] Revert "Fix alloca usage on FreeBSD" This reverts commit 01f426484406816139abb58943636bf852a0aa79. --- CMakeLists.txt | 4 +--- src/srs2.c | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f733c2..d79dacd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,10 +289,8 @@ if(WITH_SQLITE) SQLITE_OMIT_DEPRECATED SQLITE_OMIT_PROGRESS_CALLBACK SQLITE_OMIT_SHARED_CACHE + SQLITE_USE_ALLOCA ) - if(HAVE_ALLOCA_H) - target_compile_definitions(sqlite3 PRIVATE SQLITE_USE_ALLOCA) - endif() if(WITH_MILTER AND TARGET Threads::Threads) target_link_libraries(sqlite3 PRIVATE Threads::Threads) endif() diff --git a/src/srs2.c b/src/srs2.c index 606e216..9397d2e 100644 --- a/src/srs2.c +++ b/src/srs2.c @@ -20,6 +20,8 @@ #include #include +#include /* memcpy, strcpy, memset */ +#include #ifdef HAVE_ALLOCA_H # include #endif @@ -283,11 +285,7 @@ static void srs_hash_create_v(srs_t* srs, int idx, char* buf, int nargs, { data = va_arg(ap, char*); len = strlen(data); -#ifndef HAVE_ALLOCA_H - lcdata = malloc(len + 1); -#else lcdata = alloca(len + 1); -#endif for (j = 0; j < len; j++) { if (isupper(data[j])) @@ -299,9 +297,6 @@ static void srs_hash_create_v(srs_t* srs, int idx, char* buf, int nargs, HMAC_Update(&ctx, lcdata, len); #else srs_hmac_update(&ctx, lcdata, len); -#endif -#ifndef HAVE_ALLOCA_H - free(lcdata); #endif }