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());
|
RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString());
|
||||||
if (!r->IsValid()) {
|
if (!r->IsValid()) {
|
||||||
r->~RegexType();
|
r->~RegexType();
|
||||||
|
AllocatorType::Free(r);
|
||||||
r = 0;
|
r = 0;
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user