mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-11-01 21:13:15 +01:00
Fix memory leak for invalid regex
This commit is contained in:
@@ -1006,6 +1006,7 @@ private:
|
||||
RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString());
|
||||
if (!r->IsValid()) {
|
||||
r->~RegexType();
|
||||
AllocatorType::Free(r);
|
||||
r = 0;
|
||||
}
|
||||
return r;
|
||||
|
Reference in New Issue
Block a user