Skip to content

Commit 89ed59d

Browse files
authored
Add missing allocation guard in RawVec::grow
1 parent c49f280 commit 89ed59d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/liballoc/raw_vec.rs

+1
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
520520
Layout::array::<T>(cap).map_err(|_| CapacityOverflow)?
521521
}
522522
};
523+
alloc_guard(new_layout.size())?;
523524

524525
let memory = if let Some((ptr, old_layout)) = self.current_memory() {
525526
debug_assert_eq!(old_layout.align(), new_layout.align());

0 commit comments

Comments
 (0)