Skip to content

Conversation

@ericraio
Copy link
Contributor

Motivation

The bindArray function was allocating a cass_collection via cass_collection_new but never freeing it, causing a memory leak every time an array was bound to a prepared statement.

Modifications

Added defer { cass_collection_free(collection) } immediately after collection allocation to ensure proper cleanup.

Result

Collections are now properly freed after use, eliminating the memory leak in array binding operations.

Motivation:

The bindArray function was allocating a cass_collection via cass_collection_new
but never freeing it, causing a memory leak every time an array was bound to a
prepared statement.

Modifications:

Added defer { cass_collection_free(collection) } immediately after collection
allocation to ensure proper cleanup.

Result:

Collections are now properly freed after use, eliminating the memory leak in
array binding operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant