[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix memleak in glob.m4
From: |
Bruno Haible |
Subject: |
Fix memleak in glob.m4 |
Date: |
Thu, 21 May 2020 19:42:56 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) |
Tim Rühsen wrote:
> configure:67322: checking whether glob lists broken symlinks
> SUMMARY: AddressSanitizer: 37 byte(s) leaked in 2 allocation(s).
This patch should fix it.
2020-05-21 Bruno Haible <address@hidden>
glob: Avoid wrong configure results with "clang -fsanitize=leak".
Reported by Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.
* m4/glob.m4 (gl_GLOB): Free allocated memory before returning.
diff --git a/m4/glob.m4 b/m4/glob.m4
index dbd09e8..d4cd03f 100644
--- a/m4/glob.m4
+++ b/m4/glob.m4
@@ -1,4 +1,4 @@
-# glob.m4 serial 23
+# glob.m4 serial 24
dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -47,6 +47,7 @@ char a[_GNU_GLOB_INTERFACE_VERSION == 1 ||
_GNU_GLOB_INTERFACE_VERSION == 2 ? 1
[[glob_t found;
if (glob ("conf*-globtest", 0, NULL, &found) ==
GLOB_NOMATCH)
return 1;
+ globfree (&found);
]])],
[gl_cv_glob_lists_symlinks=yes],
[gl_cv_glob_lists_symlinks=no],
- Re: Fix calloc.m4 test, (continued)
- Fix invalid use of __builtin_isnanf and __builtin_isnanl, Bruno Haible, 2020/05/23
- Fix calloc-gnu configure results, Bruno Haible, 2020/05/23
- Re: Fix memleak in getdelim.m4, Bruno Haible, 2020/05/23
- Re: Fix memleak in getdelim.m4, Tim Rühsen, 2020/05/24
- SA_RESETHAND, Bruno Haible, 2020/05/21
- Re: SA_RESETHAND, Paul Eggert, 2020/05/21
- Re: SA_RESETHAND, Bruno Haible, 2020/05/21
- Re: Fix sanitizer error in fchownat.m4, Bruno Haible, 2020/05/21
- Fix memleak in glob.m4,
Bruno Haible <=
- Fix memleak in regex.m4, Bruno Haible, 2020/05/21
- Re: Fix memleak in getdelim.m4, Bruno Haible, 2020/05/21
- Re: Fix memleak in getdelim.m4, Paul Eggert, 2020/05/21
- Re: Fix memleak in getdelim.m4, Bruno Haible, 2020/05/21
Re: Fix memleak in getdelim.m4, Bruno Haible, 2020/05/21