Skip to content
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

Fix HeaderMap::drain double-free if drain iterator is forgotten #357

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

seanmonstar
Copy link
Member

Fixes #354

cc @Qwaz thanks for the report!

Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

The approach used here looks correct to me. I left some comments on nits we may want to address.

src/header/map.rs Show resolved Hide resolved
src/header/map.rs Show resolved Hide resolved
src/header/map.rs Show resolved Hide resolved
src/header/map.rs Outdated Show resolved Hide resolved
}

#[test]
fn drain_forget() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there also be a test for mem::forgetting a ValueDrain returned by a Drain?

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.

Failing to drop HeaderMap::Drain causes double-free
2 participants