Skip to content

Commit 989d7a7

Browse files
committed
rollup merge of rust-lang#19308: thestinger/oom
Closes rust-lang#19305
2 parents 6939e4f + c9816be commit 989d7a7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcollections/vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ impl<T> Vec<T> {
187187
let size = capacity.checked_mul(mem::size_of::<T>())
188188
.expect("capacity overflow");
189189
let ptr = unsafe { allocate(size, mem::min_align_of::<T>()) };
190+
if ptr.is_null() { ::alloc::oom() }
190191
Vec { ptr: ptr as *mut T, len: 0, cap: capacity }
191192
}
192193
}

0 commit comments

Comments
 (0)