advapi32: Do not call MIDL_user_free() with pointer to stack memory.
This commit is contained in:
parent
8a18e0e43a
commit
2ae8e87616
|
@ -1352,15 +1352,19 @@ done:
|
|||
static DWORD move_string_to_buffer(BYTE **buf, LPWSTR *string_ptr)
|
||||
{
|
||||
DWORD cb;
|
||||
WCHAR empty_str[] = {0};
|
||||
|
||||
if (!*string_ptr)
|
||||
*string_ptr = empty_str;
|
||||
{
|
||||
cb = sizeof(WCHAR);
|
||||
memset(*buf, 0, cb);
|
||||
}
|
||||
else
|
||||
{
|
||||
cb = (strlenW(*string_ptr) + 1)*sizeof(WCHAR);
|
||||
memcpy(*buf, *string_ptr, cb);
|
||||
MIDL_user_free(*string_ptr);
|
||||
}
|
||||
|
||||
cb = (strlenW(*string_ptr) + 1)*sizeof(WCHAR);
|
||||
|
||||
memcpy(*buf, *string_ptr, cb);
|
||||
MIDL_user_free(*string_ptr);
|
||||
*string_ptr = (LPWSTR)*buf;
|
||||
*buf += cb;
|
||||
|
||||
|
|
|
@ -857,12 +857,12 @@ static void test_sequence(void)
|
|||
SetLastError(0xdeadbeef);
|
||||
ret = QueryServiceConfigA(svc_handle, config, given, &needed);
|
||||
ok(ret, "Expected success\n");
|
||||
todo_wine
|
||||
{
|
||||
ok(GetLastError() == ERROR_SUCCESS /* W2K3 */||
|
||||
GetLastError() == 0xdeadbeef /* NT4, XP, Vista */ ||
|
||||
GetLastError() == ERROR_IO_PENDING /* W2K */,
|
||||
"Expected ERROR_SUCCESS, ERROR_IO_PENDING or 0xdeadbeef, got %d\n", GetLastError());
|
||||
todo_wine
|
||||
{
|
||||
ok(given == needed, "Expected the given (%d) and needed (%d) buffersizes to be equal\n", given, needed);
|
||||
}
|
||||
ok(config->lpBinaryPathName && config->lpLoadOrderGroup && config->lpDependencies && config->lpServiceStartName &&
|
||||
|
|
Loading…
Reference in New Issue