Fix memory leak for invalid regex
This commit is contained in:
parent
26e69ffde9
commit
e7149d6659
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user