summaryrefslogtreecommitdiffstats
path: root/modules/regex/regex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/regex/regex.cpp')
-rw-r--r--modules/regex/regex.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp
index 999a61e11a..704c107f20 100644
--- a/modules/regex/regex.cpp
+++ b/modules/regex/regex.cpp
@@ -29,6 +29,7 @@
/**************************************************************************/
#include "regex.h"
+
#include "core/os/memory.h"
extern "C" {
@@ -40,7 +41,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 {