From patchwork Mon Aug 27 21:11:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 29083 Received: (qmail 99828 invoked by alias); 27 Aug 2018 21:25:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 99659 invoked by uid 89); 27 Aug 2018 21:25:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*ucla.edu, Renamed, H*Ad:D*edu X-HELO: zimbra.cs.ucla.edu From: Paul Eggert To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [committed] regex: fix memory leak in Gnulib Date: Mon, 27 Aug 2018 14:11:46 -0700 Message-Id: <20180827211149.10421-1-eggert@cs.ucla.edu> In-Reply-To: <3db72f1d-1547-c5eb-cf78-d6198be62c55@redhat.com> References: <3db72f1d-1547-c5eb-cf78-d6198be62c55@redhat.com> 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. --- ChangeLog | 9 +++++++++ posix/regcomp.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 20d61ee5aa..dc3a4457a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2018-08-01 Paul Eggert + + 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. + 2018-08-01 H.J. Lu * sysdeps/x86/cpu-features.c (get_common_indeces): Renamed to 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); }