Skip to content

Commit 8ac9f67

Browse files
authored
fix: duckdb_logical_type leak (#3630)
`duckdb_create_vector` does not take ownership of the heap allocated memory but copies the logical type by value. Signed-off-by: Alexander Droste <[email protected]>
1 parent f23531c commit 8ac9f67

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

vortex-duckdb/src/duckdb/vector.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ wrapper!(Vector, cpp::duckdb_vector, cpp::duckdb_destroy_vector);
1212

1313
impl Vector {
1414
/// Create a new vector with the given type and capacity.
15-
/// Takes logical_type by ownership.
1615
pub fn with_capacity(logical_type: LogicalType, len: usize) -> Self {
17-
unsafe { Self::own(cpp::duckdb_create_vector(logical_type.into_ptr(), len as _)) }
16+
unsafe { Self::own(cpp::duckdb_create_vector(logical_type.as_ptr(), len as _)) }
1817
}
1918

2019
/// Converts the vector to a constant value.

0 commit comments

Comments
 (0)