--- CMakeLists.txt.orig	2023-06-08 09:17:02.000000000 -0400
+++ CMakeLists.txt	2023-10-04 11:18:30.201778000 -0400
@@ -510,7 +510,7 @@
 check_include_file( "assert.h" HAVE_ASSERT_H )
 check_include_file( "fenv.h" HAVE_FENV_H )
 check_include_file( "inttypes.h" HAVE_INTTYPES_H )
-if( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
+if( CMAKE_SYSTEM_NAME MATCHES "MidnightBSD" )
   check_include_file( "stdlib.h" HAVE_MALLOC_H )
 else()
   check_include_file( "malloc.h" HAVE_MALLOC_H )
