Skip to content

Conversation

@evanj
Copy link
Contributor

@evanj evanj commented Jan 2, 2026

Previously, these functions returned an error and a non-NULL pointer when there is an error. Most users of this API are unlikely to free the pointer on error, causing a very minor memory leak.

Fix these functions to delete the allocated C struct when returning an error. Extend the C API test to cover these cases.

Previously, these functions returned an error and a non-NULL pointer
when there is an error. Most users of this API are unlikely to free
the pointer on error, causing a very minor memory leak.

Fix these functions to delete the allocated C struct when returning
an error. Extend the C API test to cover these cases.
@meta-cla meta-cla bot added the CLA Signed label Jan 2, 2026
evanj added a commit to evanj/rust-rocksdb that referenced this pull request Jan 4, 2026
When rocksdb_create_column_family returns an error, it also returns
a non-NULL pointer that needs to be freed. I have attempted to submit
a fix for this upstream to RocksDB [1]. Add a check to free it if it
returns a non-NULL pointer, which will work with older versions of
RocksDB.

I believe this is the last of my set of fixes for valgrind reported
memory leaks in the rust-rocksdb tests.

[1] facebook/rocksdb#14214
aleksuss pushed a commit to rust-rocksdb/rust-rocksdb that referenced this pull request Jan 5, 2026
When rocksdb_create_column_family returns an error, it also returns
a non-NULL pointer that needs to be freed. I have attempted to submit
a fix for this upstream to RocksDB [1]. Add a check to free it if it
returns a non-NULL pointer, which will work with older versions of
RocksDB.

I believe this is the last of my set of fixes for valgrind reported
memory leaks in the rust-rocksdb tests.

[1] facebook/rocksdb#14214
zaidoon1 pushed a commit to zaidoon1/rust-rocksdb that referenced this pull request Jan 6, 2026
When rocksdb_create_column_family returns an error, it also returns
a non-NULL pointer that needs to be freed. I have attempted to submit
a fix for this upstream to RocksDB [1]. Add a check to free it if it
returns a non-NULL pointer, which will work with older versions of
RocksDB.

I believe this is the last of my set of fixes for valgrind reported
memory leaks in the rust-rocksdb tests.

[1] facebook/rocksdb#14214
zaidoon1 pushed a commit to zaidoon1/rust-rocksdb that referenced this pull request Jan 6, 2026
When rocksdb_create_column_family returns an error, it also returns
a non-NULL pointer that needs to be freed. I have attempted to submit
a fix for this upstream to RocksDB [1]. Add a check to free it if it
returns a non-NULL pointer, which will work with older versions of
RocksDB.

I believe this is the last of my set of fixes for valgrind reported
memory leaks in the rust-rocksdb tests.

[1] facebook/rocksdb#14214
zaidoon1 pushed a commit to zaidoon1/rust-rocksdb that referenced this pull request Jan 6, 2026
When rocksdb_create_column_family returns an error, it also returns
a non-NULL pointer that needs to be freed. I have attempted to submit
a fix for this upstream to RocksDB [1]. Add a check to free it if it
returns a non-NULL pointer, which will work with older versions of
RocksDB.

I believe this is the last of my set of fixes for valgrind reported
memory leaks in the rust-rocksdb tests.

[1] facebook/rocksdb#14214
zaidoon1 pushed a commit to zaidoon1/rust-rocksdb that referenced this pull request Jan 6, 2026
When rocksdb_create_column_family returns an error, it also returns
a non-NULL pointer that needs to be freed. I have attempted to submit
a fix for this upstream to RocksDB [1]. Add a check to free it if it
returns a non-NULL pointer, which will work with older versions of
RocksDB.

I believe this is the last of my set of fixes for valgrind reported
memory leaks in the rust-rocksdb tests.

[1] facebook/rocksdb#14214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant