Skip to content

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

Merged
seanmonstar merged 1 commit into
masterfrom
drain-double-free
Nov 25, 2019
Merged

Fix HeaderMap::drain double-free if drain iterator is forgotten#357
seanmonstar merged 1 commit into
masterfrom
drain-double-free

Conversation

@seanmonstar

Copy link
Copy Markdown
Member

Fixes #354

cc @qwaz thanks for the report!

@hawkw hawkw left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/header/map.rs
Comment thread src/header/map.rs
Comment thread src/header/map.rs
Comment thread src/header/map.rs Outdated
Comment thread tests/header_map.rs
}

#[test]
fn drain_forget() {

Copy link
Copy Markdown
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