Skip to content

Fix memory leak in Value Display implementation #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025
Merged

Fix memory leak in Value Display implementation #562

merged 1 commit into from
Aug 4, 2025

Conversation

mlafeldt
Copy link
Member

@mlafeldt mlafeldt commented Aug 4, 2025

The original code used CString::from_raw(), which takes ownership of the C string but never frees the underlying memory allocated by DuckDB. Worse, assuming ownership of memory that belonged to DuckDB's memory allocator can lead to undefined behavior.

Fixes #197

@mlafeldt mlafeldt self-assigned this Aug 4, 2025
@mlafeldt mlafeldt merged commit d2d84fa into main Aug 4, 2025
3 checks passed
@mlafeldt mlafeldt deleted the fix-197 branch August 4, 2025 14:14
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.

VTB sometimes gets BAD_ACCESS error when getting params in bind() function
1 participant