From 21bb730eac900a2737cfacf60b1209aab9f2bbde Mon Sep 17 00:00:00 2001 From: dDostalker <146743193+dDostalker@users.noreply.github.com> Date: Wed, 26 Aug 2026 17:21:43 +0800 Subject: [PATCH] =?UTF-8?q?when=20try=20grow=20raw=20a=20chunk=20which=20l?= =?UTF-8?q?en=3D0=EF=BC=8Cit=20will=20be=20leaked?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index f7b1bba..91a916f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -248,7 +248,7 @@ impl RawSmallVec { return Err(CollectionAllocErr::CapacityOverflow); } - let new_ptr = if len == 0 || !was_on_heap { + let new_ptr = if !was_on_heap { // get a fresh allocation let new_ptr = alloc(new_layout) as *mut T; // `new_layout` has nonzero size. let new_ptr =