quartz: Improve variant handling in FilterMapper_EnumMatchingFilters.

Adds VariantClear and removes unnecessary variant type assignment that may cause 
heap corruption.
This commit is contained in:
Alexander Dorofeyev 2008-06-29 15:07:24 +03:00 committed by Alexandre Julliard
parent bff9f1114a
commit 9778faee0b
1 changed files with 3 additions and 1 deletions

View File

@ -1257,7 +1257,6 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
int len;
VariantInit(&var);
V_VT(&var) = VT_BSTR;
hrSub = IMoniker_BindToStorage(IMon, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
@ -1267,6 +1266,8 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
if (SUCCEEDED(hrSub))
hrSub = CLSIDFromString(V_UNION(&var, bstrVal), &clsid);
VariantClear(&var);
if (SUCCEEDED(hrSub))
hrSub = IPropertyBag_Read(pPropBagCat, wszFriendlyName, &var, NULL);
@ -1287,6 +1288,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
if (pPropBagCat)
IPropertyBag_Release(pPropBagCat);
IMoniker_Release(IMon);
VariantClear(&var);
}
/* In case of release all resources */