Skip to content
Snippets Groups Projects
Commit 57c24299 authored by Michael Davis's avatar Michael Davis
Browse files

[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.
parent 9aacea1e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment