Fix memory leak when no item found.