From: Yuxuan Shui yshui@codeweavers.com
And the WSTR it returns should be freed by CoTaskMemFree, as per Microsoft's documentation.
Found by ASan. --- dlls/opcservices/package.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/opcservices/package.c b/dlls/opcservices/package.c index 7b62224b846..b5a8537bb3d 100644 --- a/dlls/opcservices/package.c +++ b/dlls/opcservices/package.c @@ -1608,7 +1608,8 @@ static HRESULT opc_package_add_default_content_type(struct content_types *types, static HRESULT opc_package_add_content_type(struct content_types *types, IOpcPart *part) { struct content_type *cur; - BSTR ext, content_type; + BSTR ext; + WCHAR *content_type; BOOL added = FALSE; IOpcPartUri *name; HRESULT hr; @@ -1652,7 +1653,7 @@ static HRESULT opc_package_add_content_type(struct content_types *types, IOpcPar hr = opc_package_add_default_content_type(types, ext, content_type);
SysFreeString(ext); - SysFreeString(content_type); + CoTaskMemFree(content_type);
return hr; }