That's currently a bug due to changes for the new client.
On Windows you won't even get that far and crash directly in the function call (at least with your code).
Once fixed, to release allocated memory you will have to call freeMemory for the main pointer and the folder member of each item where isFolder is true.
Thanks for report.
Last edited by Chris; January 24th, 2017 at 02:50 PM.
When sending PMs please make sure to include a reference link to the thread in question in the body of your message.