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

delete chunk buffer for VectorReadInfo after copying into python string #1440

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

nikoladze
Copy link
Contributor

This should fix #1400. I added a delete after a chunk buffer is copied into a python string in the conversion function for VectorReadInfo, analogous to what is done here for ChunkInfo:

template<> struct PyDict<XrdCl::ChunkInfo>
{
static PyObject* Convert( XrdCl::ChunkInfo *chunk )
{
PyObject *o = PyBytes_FromStringAndSize( (const char*)chunk->buffer,
chunk->length );
delete[] (char*) chunk->buffer;
return o;
}
};

@nikoladze
Copy link
Contributor Author

The memory leak in the example in #1400 is indeed gone

image

@simonmichal
Copy link
Contributor

Thanks a lot!

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.

Memory leak in vector_read for pyxrootd
2 participants