Well it could be helpful and insightful if you can share a small memory dump for the data pointed by that EpisodeID, use the debugger and capture a screenshot of that address content and most importantly few bytes before it like 4 (if it is BSTR for real) like this
Anyway, from reading this :
https://learn.microsoft.com/en-us/pr...p/automat/bstr
Can you try SysFreeString and see if that clear the string without problem ?
https://learn.microsoft.com/en-us/wi...-sysfreestring