Merge pull request #23726 from ibrahn/fix-regex-double-free

Assign pointer null in RegEx::clear to avoid double free on destruction.
This commit is contained in:
Rémi Verschelde 2018-11-15 15:17:11 +01:00 committed by GitHub
commit 14cf450b0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
}