From 6e08e2942509389dbeec137c6079c464b92ba646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Dupuis?= Date: Thu, 5 Oct 2017 11:39:21 +0200 Subject: [PATCH] Initialized regex with schema allocator. --- include/rapidjson/schema.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index abcf1a1..d884064 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -935,7 +935,7 @@ private: }; #if RAPIDJSON_SCHEMA_USE_INTERNALREGEX - typedef internal::GenericRegex RegexType; + typedef internal::GenericRegex RegexType; #elif RAPIDJSON_SCHEMA_USE_STDREGEX typedef std::basic_regex RegexType; #else @@ -995,7 +995,7 @@ private: template RegexType* CreatePattern(const ValueType& value) { if (value.IsString()) { - RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString()); + RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_); if (!r->IsValid()) { r->~RegexType(); AllocatorType::Free(r);