Skip to content

Commit

Permalink
Revert "Fix alloca usage on FreeBSD"
Browse files Browse the repository at this point in the history
This reverts commit 01f4264.
  • Loading branch information
roehling committed Aug 7, 2023
1 parent 01f4264 commit 932357a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 2 additions & 7 deletions src/srs2.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include <postsrsd_build_config.h>
#include <stdarg.h>
#include <string.h> /* memcpy, strcpy, memset */
#include <strings.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
Expand Down Expand Up @@ -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]))
Expand All @@ -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
}

Expand Down

0 comments on commit 932357a

Please sign in to comment.