Skip to content
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

c_src/eleveldb.cc:652]: (error) Memory leak: batch [JIRA: RIAK-2734] #212

Open
dcb314 opened this issue Aug 8, 2016 · 4 comments
Open

Comments

@dcb314
Copy link

dcb314 commented Aug 8, 2016

Source code is

// Construct a write batch:
leveldb::WriteBatch* batch = new leveldb::WriteBatch;

// Seed the batch's data:
ERL_NIF_TERM result = fold(env, argv[2], write_batch_item, *batch);
if(eleveldb::ATOM_OK != result)
{
    return send_reply(env, caller_ref,
                      enif_make_tuple3(env, eleveldb::ATOM_ERROR, caller_ref,
                                       enif_make_tuple2(env, eleveldb::ATOM_BAD_WRITE_ACTION,
                                                        result)));
}   // if
@Basho-JIRA Basho-JIRA changed the title c_src/eleveldb.cc:652]: (error) Memory leak: batch c_src/eleveldb.cc:652]: (error) Memory leak: batch [JIRA: RIAK-2734] Aug 8, 2016
@matthewvon
Copy link
Contributor

Agreed.

@larshesel
Copy link

The leak would be due to batch never being freed?

@matthewvon
Copy link
Contributor

No clue why this was never closed. Fix is present in code. See

d595ae3

Batch is now freed in error handling.

@larshesel
Copy link

oh, cool - I hadn't seen that, only checked this bug was present in our version. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants