Skip to content

Commit 763392c

Browse files
committed
Fix memory leak in P::filter_map
1 parent af2c159 commit 763392c

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)