Commit 0aa56cab authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dxdiagn: Improve error handling when converting to VT_BSTR (Coverity).

parent a0b8f178
...@@ -346,6 +346,7 @@ static inline HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, co ...@@ -346,6 +346,7 @@ static inline HRESULT add_bool_property(IDxDiagContainerImpl_Container *node, co
static inline HRESULT add_ull_as_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, ULONGLONG data ) static inline HRESULT add_ull_as_bstr_property(IDxDiagContainerImpl_Container *node, const WCHAR *propName, ULONGLONG data )
{ {
IDxDiagContainerImpl_Property *prop; IDxDiagContainerImpl_Property *prop;
HRESULT hr;
prop = allocate_property_information(propName); prop = allocate_property_information(propName);
if (!prop) if (!prop)
...@@ -354,7 +355,12 @@ static inline HRESULT add_ull_as_bstr_property(IDxDiagContainerImpl_Container *n ...@@ -354,7 +355,12 @@ static inline HRESULT add_ull_as_bstr_property(IDxDiagContainerImpl_Container *n
V_VT(&prop->vProp) = VT_UI8; V_VT(&prop->vProp) = VT_UI8;
V_UI8(&prop->vProp) = data; V_UI8(&prop->vProp) = data;
VariantChangeType(&prop->vProp, &prop->vProp, 0, VT_BSTR); hr = VariantChangeType(&prop->vProp, &prop->vProp, 0, VT_BSTR);
if (FAILED(hr))
{
free_property_information(prop);
return hr;
}
list_add_tail(&node->properties, &prop->entry); list_add_tail(&node->properties, &prop->entry);
++node->nProperties; ++node->nProperties;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment