fix(review): fix possible memory leak from code review