forked from Mirrors/wine-wine
wsdapi: Fix some memory leaks (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>stable
parent
e9c90afc06
commit
18ac7e15aa
|
@ -1426,6 +1426,9 @@ static HRESULT ws_element_to_wsdxml_element(WS_XML_READER *reader, IWSDXMLContex
|
||||||
if (FAILED(ret)) goto cleanup;
|
if (FAILED(ret)) goto cleanup;
|
||||||
WSDXMLAddChild(cur_element, element);
|
WSDXMLAddChild(cur_element, element);
|
||||||
|
|
||||||
|
WSDFreeLinkedMemory(name);
|
||||||
|
name = NULL;
|
||||||
|
|
||||||
cur_wsd_attrib = NULL;
|
cur_wsd_attrib = NULL;
|
||||||
|
|
||||||
/* Add attributes */
|
/* Add attributes */
|
||||||
|
@ -1462,6 +1465,9 @@ static HRESULT ws_element_to_wsdxml_element(WS_XML_READER *reader, IWSDXMLContex
|
||||||
new_wsd_attrib->Element = cur_element;
|
new_wsd_attrib->Element = cur_element;
|
||||||
new_wsd_attrib->Next = NULL;
|
new_wsd_attrib->Next = NULL;
|
||||||
|
|
||||||
|
WSDAttachLinkedMemory(new_wsd_attrib, name);
|
||||||
|
name = NULL;
|
||||||
|
|
||||||
if (cur_wsd_attrib == NULL)
|
if (cur_wsd_attrib == NULL)
|
||||||
element->FirstAttribute = new_wsd_attrib;
|
element->FirstAttribute = new_wsd_attrib;
|
||||||
else
|
else
|
||||||
|
@ -1524,6 +1530,7 @@ outofmemory:
|
||||||
cleanup:
|
cleanup:
|
||||||
/* Free uri and element_name if applicable */
|
/* Free uri and element_name if applicable */
|
||||||
WSDFreeLinkedMemory(uri);
|
WSDFreeLinkedMemory(uri);
|
||||||
|
WSDFreeLinkedMemory(name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1712,10 +1719,10 @@ HRESULT read_message(IWSDiscoveryPublisherImpl *impl, const char *xml, int xml_l
|
||||||
IWSDXMLContext *context = NULL;
|
IWSDXMLContext *context = NULL;
|
||||||
WS_XML_STRING *soap_uri = NULL;
|
WS_XML_STRING *soap_uri = NULL;
|
||||||
const WS_XML_NODE *node;
|
const WS_XML_NODE *node;
|
||||||
WS_XML_READER *reader;
|
WS_XML_READER *reader = NULL;
|
||||||
LPCWSTR value = NULL;
|
LPCWSTR value = NULL;
|
||||||
LPWSTR uri, prefix;
|
LPWSTR uri, prefix;
|
||||||
WS_HEAP *heap;
|
WS_HEAP *heap = NULL;
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1945,6 +1952,8 @@ cleanup:
|
||||||
free_xml_string(soap_uri);
|
free_xml_string(soap_uri);
|
||||||
WSDFreeLinkedMemory(soap_msg);
|
WSDFreeLinkedMemory(soap_msg);
|
||||||
if (context != NULL) IWSDXMLContext_Release(context);
|
if (context != NULL) IWSDXMLContext_Release(context);
|
||||||
|
if (reader != NULL) WsFreeReader(reader);
|
||||||
|
if (heap != NULL) WsFreeHeap(heap);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue