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:
parent
bff9f1114a
commit
9778faee0b
|
@ -1257,7 +1257,6 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
VariantInit(&var);
|
VariantInit(&var);
|
||||||
V_VT(&var) = VT_BSTR;
|
|
||||||
|
|
||||||
hrSub = IMoniker_BindToStorage(IMon, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
|
hrSub = IMoniker_BindToStorage(IMon, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
|
||||||
|
|
||||||
|
@ -1267,6 +1266,8 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
|
||||||
if (SUCCEEDED(hrSub))
|
if (SUCCEEDED(hrSub))
|
||||||
hrSub = CLSIDFromString(V_UNION(&var, bstrVal), &clsid);
|
hrSub = CLSIDFromString(V_UNION(&var, bstrVal), &clsid);
|
||||||
|
|
||||||
|
VariantClear(&var);
|
||||||
|
|
||||||
if (SUCCEEDED(hrSub))
|
if (SUCCEEDED(hrSub))
|
||||||
hrSub = IPropertyBag_Read(pPropBagCat, wszFriendlyName, &var, NULL);
|
hrSub = IPropertyBag_Read(pPropBagCat, wszFriendlyName, &var, NULL);
|
||||||
|
|
||||||
|
@ -1287,6 +1288,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
|
||||||
if (pPropBagCat)
|
if (pPropBagCat)
|
||||||
IPropertyBag_Release(pPropBagCat);
|
IPropertyBag_Release(pPropBagCat);
|
||||||
IMoniker_Release(IMon);
|
IMoniker_Release(IMon);
|
||||||
|
VariantClear(&var);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In case of release all resources */
|
/* In case of release all resources */
|
||||||
|
|
Loading…
Reference in New Issue