Skip to content

Commit

Permalink
regex: Add nullptr check in _regex_free, needed with PCRE2 10.42
Browse files Browse the repository at this point in the history
Fixes godotengine#76174.

(cherry picked from commit 290db4a)
  • Loading branch information
akien-mga committed Aug 18, 2023
1 parent 8c1a8d4 commit 4044b19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/regex/regex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4044b19

Please sign in to comment.