wolfSCP allocates a few buffers as needed and frees them immediately when done. It also checks at shutdown if the buffers need to be freed and frees them. When copying a large file (sink action), it will alloc and free the file buffer for each chunk of file sent by the peer. This could lead to fragmentation. Change the file receive and command buffers to be allocated when needed, and don't free them until cleanup.
DESCRIPTION
wolfSCP allocates a few buffers as needed and frees them immediately when done. It also checks at shutdown if the buffers need to be freed and frees them. When copying a large file (sink action), it will alloc and free the file buffer for each chunk of file sent by the peer. This could lead to fragmentation. Change the file receive and command buffers to be allocated when needed, and don't free them until cleanup.
TESTING