diff --git a/crates/polars-core/src/series/arithmetic/list_borrowed.rs b/crates/polars-core/src/series/arithmetic/list_borrowed.rs index f6022a3db4cf..76ee0d98f5b8 100644 --- a/crates/polars-core/src/series/arithmetic/list_borrowed.rs +++ b/crates/polars-core/src/series/arithmetic/list_borrowed.rs @@ -85,7 +85,9 @@ impl Op { // Safety: All operations return the same type macro_rules! wrap { ($e:expr) => { - unsafe { core::mem::transmute_copy(&$e) } + // Safety: This performs a `Copy`, but `$e` could be a `Series`, + // so we need to wrap in `ManuallyDrop` to avoid double-free. + unsafe { core::mem::transmute_copy(&core::mem::ManuallyDrop::new($e)) } }; }