[PATCH] wsdapi/tests: Avoid calls to malloc() and free().

Francois Gouget fgouget at free.fr
Thu Aug 23 09:43:41 CDT 2018


Signed-off-by: Francois Gouget <fgouget at free.fr>
---
 dlls/wsdapi/tests/discovery.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/wsdapi/tests/discovery.c b/dlls/wsdapi/tests/discovery.c
index 43a4b2c3a44..f33f469a033 100644
--- a/dlls/wsdapi/tests/discovery.c
+++ b/dlls/wsdapi/tests/discovery.c
@@ -1029,20 +1029,20 @@ static void Publish_tests(void)
     another_name.LocalName = (WCHAR *) name_cider;
     another_name.Space = &ns2;
 
-    types_list.Next = malloc(sizeof(WSD_NAME_LIST));
+    types_list.Next = heap_alloc(sizeof(WSD_NAME_LIST));
     types_list.Element = &another_name;
 
     types_list.Next->Next = NULL;
     types_list.Next->Element = &header_any_name;
 
     /* Create scopes and xaddrs lists */
-    scopes_list.Next = malloc(sizeof(WSD_URI_LIST));
+    scopes_list.Next = heap_alloc(sizeof(WSD_URI_LIST));
     scopes_list.Element = uri;
 
     scopes_list.Next->Next = NULL;
     scopes_list.Next->Element = uri_more_tests;
 
-    xaddrs_list.Next = malloc(sizeof(WSD_URI_LIST));
+    xaddrs_list.Next = heap_alloc(sizeof(WSD_URI_LIST));
     xaddrs_list.Element = uri_more_tests;
 
     xaddrs_list.Next->Next = NULL;
@@ -1056,9 +1056,9 @@ static void Publish_tests(void)
     WSDFreeLinkedMemory(body_any_element);
     WSDFreeLinkedMemory(endpoint_any_element);
     WSDFreeLinkedMemory(ref_param_any_element);
-    free(types_list.Next);
-    free(scopes_list.Next);
-    free(xaddrs_list.Next);
+    heap_free(types_list.Next);
+    heap_free(scopes_list.Next);
+    heap_free(xaddrs_list.Next);
 
     ok(rc == S_OK, "Publish failed: %08x\n", rc);
 
-- 
2.18.0




More information about the wine-devel mailing list