Skip to content

Commit 7fb44e8

Browse files
authored
Rollup merge of rust-lang#57667 - ishitatsuyuki:p-leak, r=nnethercote
Fix memory leak in P::filter_map Probably this function isn't widely used, but anyway this wasn't working as intended. r? @eddyb Do not rollup if you want to see if max-rss change in perf.
2 parents ad55b73 + 763392c commit 7fb44e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libsyntax/ptr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ impl<T: 'static> P<T> {
101101
// Recreate self from the raw pointer.
102102
Some(P { ptr: Box::from_raw(p) })
103103
} else {
104+
drop(Box::from_raw(p));
104105
None
105106
}
106107
}

0 commit comments

Comments
 (0)