Skip to content

Commit 11df2a8

Browse files
authored
Merge pull request #78137 from akien-mga/4.0-regex-nullptr-free
[4.0] regex: Add nullptr check in `_regex_free`, needed with PCRE2 10.42
2 parents da3f725 + 290db4a commit 11df2a8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

modules/regex/regex.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ static void *_regex_malloc(PCRE2_SIZE size, void *user) {
4040
}
4141

4242
static void _regex_free(void *ptr, void *user) {
43-
memfree(ptr);
43+
if (ptr) {
44+
memfree(ptr);
45+
}
4446
}
4547

4648
int RegExMatch::_find(const Variant &p_name) const {

0 commit comments

Comments
 (0)