Francois Gouget : ntdll/tests: Replace malloc() with HeapAlloc().
Alexandre Julliard
julliard at winehq.org
Wed May 13 10:19:44 CDT 2009
Module: wine
Branch: master
Commit: d6a9082dc48f00328aefa528b2b510259d298f95
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d6a9082dc48f00328aefa528b2b510259d298f95
Author: Francois Gouget <fgouget at free.fr>
Date: Wed May 13 10:32:38 2009 +0200
ntdll/tests: Replace malloc() with HeapAlloc().
---
dlls/ntdll/tests/rtlstr.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c
index e1d4be7..53f0c80 100644
--- a/dlls/ntdll/tests/rtlstr.c
+++ b/dlls/ntdll/tests/rtlstr.c
@@ -89,7 +89,7 @@ static WCHAR* AtoW( const char* p )
{
WCHAR* buffer;
DWORD len = MultiByteToWideChar( CP_ACP, 0, p, -1, NULL, 0 );
- buffer = malloc( len * sizeof(WCHAR) );
+ buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, p, -1, buffer, len );
return buffer;
}
@@ -191,7 +191,7 @@ static void test_RtlInitUnicodeStringEx(void)
UNICODE_STRING uni;
NTSTATUS result;
- teststring2 = malloc((TESTSTRING2_LEN + 1) * sizeof(WCHAR));
+ teststring2 = HeapAlloc(GetProcessHeap(), 0, (TESTSTRING2_LEN + 1) * sizeof(WCHAR));
memset(teststring2, 'X', TESTSTRING2_LEN * sizeof(WCHAR));
teststring2[TESTSTRING2_LEN] = '\0';
@@ -293,7 +293,7 @@ static void test_RtlInitUnicodeStringEx(void)
"pRtlInitUnicodeString(&uni, 0) sets Buffer to %p, expected %p\n",
uni.Buffer, NULL);
- free(teststring2);
+ HeapFree(GetProcessHeap(), 0, teststring2);
}
@@ -1364,7 +1364,7 @@ static void test_RtlUnicodeStringToInteger(void)
ok(value == 0xdeadbeef || value == 0 /* vista */,
"(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected 0 or deadbeef\n",
test_num, str2int[test_num].str, str2int[test_num].base, value);
- free(wstr);
+ HeapFree(GetProcessHeap(), 0, wstr);
}
wstr = AtoW(str2int[1].str);
@@ -1404,7 +1404,7 @@ static void test_RtlUnicodeStringToInteger(void)
"didn't return expected value (test c): expected: %d, got: %d\n",
1, value);
/* w2k: uni.Length = 0 returns value 11234567 instead of 0 */
- free(wstr);
+ HeapFree(GetProcessHeap(), 0, wstr);
}
More information about the wine-cvs
mailing list