-
- Downloads
[ssi_af_ls] Corrects memory allocation for Data/Stream responses
In the case of a Stream response, XRootD allocates the memory and manipulates the buffer pointer. In the case of a Data response, we need to allocate the buffer ourselves. In both cases, the buffer is treated in ProcessResponseData(), which does not care how the buffer was filled. This requires a bit of extra logic to make sure the buffer is deallocated for Data responses but not Stream responses. I have done this using a unique pointer to allocate a char[] for Data responses. and char *m_buffer_ptr points to the memory allocated. We never delete m_buffer_ptr as memory allocation is handled either by the unique_ptr or by XRoot and we don't care which.
Loading
Please register or sign in to comment