From 96937d47ac9a177ce5fb8d342acc5651a25dd979 Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Tue, 15 Oct 2013 15:01:44 +0000 Subject: [PATCH] re PR libstdc++/58737 (leak in std::regex_match) 2013-10-15 Tim Shen PR libstdc++/58737 * include/bits/regex_automaton.h (_Automaton<>::~_Automaton): Fix memory leak by adding it. * include/bits/regex_executor.h (_Executor<>::~_Executor): Likewise. From-SVN: r203610 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/bits/regex_automaton.h | 4 ++++ libstdc++-v3/include/bits/regex_executor.h | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6148b0b..b1d6e04 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2013-10-15 Tim Shen + + PR libstdc++/58737 + * include/bits/regex_automaton.h (_Automaton<>::~_Automaton): Fix memory + leak by adding it. + * include/bits/regex_executor.h (_Executor<>::~_Executor): Likewise. + 2013-10-11 H.J. Lu * config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Update. diff --git a/libstdc++-v3/include/bits/regex_automaton.h b/libstdc++-v3/include/bits/regex_automaton.h index 60744b2..35cfc1b 100644 --- a/libstdc++-v3/include/bits/regex_automaton.h +++ b/libstdc++-v3/include/bits/regex_automaton.h @@ -112,6 +112,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef size_t _SizeT; public: + virtual + ~_Automaton() + { } + virtual _SizeT _M_sub_count() const = 0; diff --git a/libstdc++-v3/include/bits/regex_executor.h b/libstdc++-v3/include/bits/regex_executor.h index 4626437..23b5d01 100644 --- a/libstdc++-v3/include/bits/regex_executor.h +++ b/libstdc++-v3/include/bits/regex_executor.h @@ -83,6 +83,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : __flags) { } + virtual + ~_Executor() + { } + // Set matched when string exactly match the pattern. bool _M_match() -- 2.7.4