regex: Add nullptr check in `_regex_free`, needed with PCRE2 10.42

Fixes #76174.

(cherry picked from commit 290db4a0b6)
This commit is contained in:
Rémi Verschelde 2023-06-12 15:19:51 +02:00
parent 8c1a8d4396
commit 4044b19100
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,9 @@ static void *_regex_malloc(PCRE2_SIZE size, void *user) {
}
static void _regex_free(void *ptr, void *user) {
memfree(ptr);
if (ptr) {
memfree(ptr);
}
}
int RegExMatch::_find(const Variant &p_name) const {