summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-08-01 13:22:16 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-08-01 13:22:58 -0700
commitfa67ba06ee07845a2bac34afa609ee2bbb1e017e (patch)
tree56769f8ccbe4ba8d36047aed5f620a16c274c451 /posix
parent82c80ac2ebf9acc81ec460adfd951d4884836c7c (diff)
downloadglibc-fa67ba06ee07845a2bac34afa609ee2bbb1e017e.tar.gz
glibc-fa67ba06ee07845a2bac34afa609ee2bbb1e017e.tar.xz
glibc-fa67ba06ee07845a2bac34afa609ee2bbb1e017e.zip
regex: fix memory leak in Gnulib
Problem and fix reported by Assaf Gordon in:
https://lists.gnu.org/r/bug-gnulib/2018-07/txtqLKNwBdefE.txt
* posix/regcomp.c (free_charset) [!_LIBC]: Free range_starts and
range_ends members too, as they are defined in 'struct
re_charset_t' even if not _LIBC.  This affects only Gnulib.
Diffstat (limited to 'posix')
-rw-r--r--posix/regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 545d188468..3b0a3c6b6a 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -3794,9 +3794,9 @@ free_charset (re_charset_t *cset)
 # ifdef _LIBC
   re_free (cset->coll_syms);
   re_free (cset->equiv_classes);
+# endif
   re_free (cset->range_starts);
   re_free (cset->range_ends);
-# endif
   re_free (cset->char_classes);
   re_free (cset);
 }