Add missing curly brackets in STDREGEX's CreatePattern().

This commit is contained in:
ylavic 2019-04-29 15:06:52 +02:00
parent 01950eb7ac
commit 94fc463801

View File

@ -1149,7 +1149,7 @@ private:
#elif RAPIDJSON_SCHEMA_USE_STDREGEX
template <typename ValueType>
RegexType* CreatePattern(const ValueType& value) {
if (value.IsString())
if (value.IsString()) {
RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType)));
try {
return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
@ -1157,6 +1157,7 @@ private:
catch (const std::regex_error&) {
AllocatorType::Free(r);
}
}
return 0;
}