Dynamically allocated memory returned from method calls should be allocated by CoTaskMemAlloc and freed by CoTaskMemFree.