diff --git a/db/c.cc b/db/c.cc index 0f9d52010..73c9db501 100644 --- a/db/c.cc +++ b/db/c.cc @@ -4790,7 +4790,10 @@ void rocksdb_transaction_destroy(rocksdb_transaction_t* txn) { const rocksdb_snapshot_t* rocksdb_transaction_get_snapshot( rocksdb_transaction_t* txn) { - rocksdb_snapshot_t* result = new rocksdb_snapshot_t; + // This will be freed later on using free, so use malloc here to avoid a + // mismatch + rocksdb_snapshot_t* result = + (rocksdb_snapshot_t*)malloc(sizeof(rocksdb_snapshot_t)); result->rep = txn->rep->GetSnapshot(); return result; }