about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/liballoc/raw_vec.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs
index 590e82357fb..2bf40490e78 100644
--- a/src/liballoc/raw_vec.rs
+++ b/src/liballoc/raw_vec.rs
@@ -520,6 +520,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
                 Layout::array::<T>(cap).map_err(|_| CapacityOverflow)?
             }
         };
+        alloc_guard(new_layout.size())?;
 
         let memory = if let Some((ptr, old_layout)) = self.current_memory() {
             debug_assert_eq!(old_layout.align(), new_layout.align());