We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 01950eb + 94fc463 commit 4b3d7c2Copy full SHA for 4b3d7c2
include/rapidjson/schema.h
@@ -1149,14 +1149,15 @@ class Schema {
1149
#elif RAPIDJSON_SCHEMA_USE_STDREGEX
1150
template <typename ValueType>
1151
RegexType* CreatePattern(const ValueType& value) {
1152
- if (value.IsString())
+ if (value.IsString()) {
1153
RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType)));
1154
try {
1155
return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
1156
}
1157
catch (const std::regex_error&) {
1158
AllocatorType::Free(r);
1159
1160
+ }
1161
return 0;
1162
1163
0 commit comments