Skip to content

vec::IntoIter fixes - #181

Merged
fitzgen merged 2 commits into
fitzgen:mainfrom
main--:vec-intoiter-fixes
Oct 18, 2022
Merged

fitzgen merged 2 commits into
fitzgen:mainfrom
main--:vec-intoiter-fixes

Conversation

@main--

@main-- main-- commented Oct 14, 2022

Copy link
Copy Markdown
Contributor

Ran into these issues while tracking down a memory leak.

IntoIter was missing a 'borrow lifetime parameter, leading to trivial
use-after-free issues (fixes fitzgen#187).
Both Vec and Drain drop leftover elements when they are dropped.
It would be inconsistent for IntoIter to just leak them.
@konsumlamm

Copy link
Copy Markdown
Contributor

This fixes #178.

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! One comment to be addressed before this can merge.

Comment thread src/collections/vec.rs

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@fitzgen
fitzgen merged commit f63d768 into fitzgen:main Oct 18, 2022
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 this pull request may close these issues.

3 participants