Update Gnulib to the latest git version
[deliverable/binutils-gdb.git] / gnulib / import / m4 / memmem.m4
index 981ede76b40a473f60421cf91f02e8ed5413bb92..dcccefa70450a344b6a1866d66a1dca9719883e6 100644 (file)
@@ -1,5 +1,5 @@
-# memmem.m4 serial 24
-dnl Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+# memmem.m4 serial 26
+dnl Copyright (C) 2002-2004, 2007-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
   if test $ac_cv_have_decl_memmem = no; then
     HAVE_DECL_MEMMEM=0
   else
-    dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
+    dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092.
     dnl Also check that we handle empty needles correctly.
     AC_CACHE_CHECK([whether memmem works],
       [gl_cv_func_memmem_works_always],
@@ -68,7 +68,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
 #endif
            ],
            [gl_cv_func_memmem_works_always="guessing yes"],
-           [gl_cv_func_memmem_works_always="guessing no"])
+           [gl_cv_func_memmem_works_always="$gl_cross_guess_normal"])
         ])
       ])
     case "$gl_cv_func_memmem_works_always" in
@@ -113,6 +113,9 @@ static void quit (int sig) { _exit (sig + 128); }
         if (!memmem (haystack, 2 * m + 1, needle, m + 1))
           result |= 1;
       }
+    /* Free allocated memory, in case some sanitizer is watching.  */
+    free (haystack);
+    free (needle);
     return result;
     ]])],
         [gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no],
@@ -135,7 +138,7 @@ static void quit (int sig) { _exit (sig + 128); }
 #endif
            ],
            [gl_cv_func_memmem_works_fast="guessing yes"],
-           [gl_cv_func_memmem_works_fast="guessing no"])
+           [gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"])
         ])
       ])
     case "$gl_cv_func_memmem_works_fast" in
This page took 0.025176 seconds and 4 git commands to generate.