diff options
| author | Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> | 2020-04-01 10:26:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-01 10:26:30 +0200 |
| commit | 89ed59d8841a2b6057f61a3469c10bb2e6242160 (patch) | |
| tree | 1ec6397b24b778a2e987ace033de007e46bf2756 /src/liballoc | |
| parent | c49f28005d8f636272f3103e6ecaa1affb7bf31b (diff) | |
| download | rust-89ed59d8841a2b6057f61a3469c10bb2e6242160.tar.gz rust-89ed59d8841a2b6057f61a3469c10bb2e6242160.zip | |
Add missing allocation guard in `RawVec::grow`
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/raw_vec.rs | 1 |
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()); |
