diff --git a/configure b/configure index 53a6dd0297..dbc16b5656 100755 --- a/configure +++ b/configure @@ -4587,7 +4587,13 @@ fi if test "$tcmalloc" = "yes" ; then cat > $TMPC << EOF #include -int main(void) { malloc(1); return 0; } +int main(void) { + void *tmp = malloc(1); + if (tmp != NULL) { + return 0; + } + return 1; +} EOF if compile_prog "" "-ltcmalloc" ; then @@ -4603,7 +4609,13 @@ fi if test "$jemalloc" = "yes" ; then cat > $TMPC << EOF #include -int main(void) { malloc(1); return 0; } +int main(void) { + void *tmp = malloc(1); + if (tmp != NULL) { + return 0; + } + return 1; +} EOF if compile_prog "" "-ljemalloc" ; then @@ -6164,7 +6176,9 @@ if test "$sanitizers" = "yes" ; then #include int main(void) { void *tmp = malloc(10); - return *(int *)(tmp + 2); + if (tmp != NULL) { + return *(int *)(tmp + 2); + } } EOF if compile_prog "$CPU_CFLAGS -Werror -fsanitize=undefined" ""; then