Skip to content

Commit

Permalink
Fix another latent bug in Regexp::Walker<T>::Reset().
Browse files Browse the repository at this point in the history
Change-Id: I41ade89efd93fed2a704d718659476eeb9fe6f83
Reviewed-on: https://code-review.googlesource.com/c/re2/+/59390
Reviewed-by: Perry Lorier <[email protected]>
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Oct 27, 2021
1 parent e90569d commit 7424791
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion re2/walker-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ template<typename T> void Regexp::Walker<T>::Reset() {
if (!stack_.empty()) {
LOG(DFATAL) << "Stack not empty.";
while (!stack_.empty()) {
delete[] stack_.top().child_args;
if (stack_.top().re->nsub_ > 1)
delete[] stack_.top().child_args;
stack_.pop();
}
}
Expand Down

0 comments on commit 7424791

Please sign in to comment.