mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 23:31:53 -05:00
Assign pointer null in RegEx::clear to avoid double free on destruction.
(cherry picked from commit f8a1c77fcf)
This commit is contained in:
committed by
Rémi Verschelde
parent
f666a5f34a
commit
0b2a884fe2
@@ -178,13 +178,17 @@ void RegEx::clear() {
|
|||||||
|
|
||||||
if (sizeof(CharType) == 2) {
|
if (sizeof(CharType) == 2) {
|
||||||
|
|
||||||
if (code)
|
if (code) {
|
||||||
pcre2_code_free_16((pcre2_code_16 *)code);
|
pcre2_code_free_16((pcre2_code_16 *)code);
|
||||||
|
code = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (code)
|
if (code) {
|
||||||
pcre2_code_free_32((pcre2_code_32 *)code);
|
pcre2_code_free_32((pcre2_code_32 *)code);
|
||||||
|
code = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user