diff options
author | Ibrahn Sahir <ibrahn.sahir@gmail.com> | 2018-11-15 13:36:40 +0000 |
---|---|---|
committer | Ibrahn Sahir <ibrahn.sahir@gmail.com> | 2018-11-15 13:36:40 +0000 |
commit | f8a1c77fcf1f501317f04528c31088d19e47ae86 (patch) | |
tree | 5344f49f8d641423398b2049351e8a7e4a029031 /modules | |
parent | 35aa3301d760d3f548c2ee432f5e8f1977ec9c05 (diff) |
Assign pointer null in RegEx::clear to avoid double free on destruction.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/regex/regex.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index bdd3e31eb8..03ef024587 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -178,13 +178,17 @@ void RegEx::clear() { if (sizeof(CharType) == 2) { - if (code) + if (code) { pcre2_code_free_16((pcre2_code_16 *)code); + code = NULL; + } } else { - if (code) + if (code) { pcre2_code_free_32((pcre2_code_32 *)code); + code = NULL; + } } } |