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
  • Loading branch information
akien-mga committed Jun 12, 2023
1 parent da3f725 commit 290db4a
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 290db4a

Please sign in to comment.