Skip to content

ThinBox::clone() leaks Head if the iterator panics #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adlerd opened this issue Mar 18, 2020 · 1 comment · Fixed by #11
Closed

ThinBox::clone() leaks Head if the iterator panics #10

adlerd opened this issue Mar 18, 2020 · 1 comment · Fixed by #11

Comments

@adlerd
Copy link

adlerd commented Mar 18, 2020

A typo in ThinBox::clone() causes it to drop_in_place a u8, not a Head.

A test which demonstrates this is here.

I will follow up with a PR adding this test and fixing the issue, which are probably the best way to explain it, although I didn't give my full attention to make sure the fix is doing the right thing so someone should look closely :). I think a more complete fix would be to remove the Head from InProgressThinBox entirely as I'm not sure it really needs to be there.

@CAD97
Copy link
Owner

CAD97 commented Mar 19, 2020

FWIW, this prompted me to go clean up my panics over in slice-dst as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants