Commit 787ab457 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

shlwapi/tests: Don't access memory when the allocation failed.

parent 77e1b38f
......@@ -2889,8 +2889,11 @@ static void test_SHGetShellKey(void)
hres = pSKAllocValueW(SHKEY_Root_HKLM, WineTestW, NULL, NULL, (void**)&alloc_data, &size);
ok(hres == S_OK, "hres= %x\n", hres);
ok(size == sizeof(DWORD), "size = %d\n", size);
ok(*alloc_data == 1234, "*alloc_data = %d\n", *alloc_data);
LocalFree(alloc_data);
if (SUCCEEDED(hres))
{
ok(*alloc_data == 1234, "*alloc_data = %d\n", *alloc_data);
LocalFree(alloc_data);
}
hres = pSKDeleteValueW(SHKEY_Root_HKLM, WineTestW, NULL);
ok(hres == S_OK, "hres = %x\n", hres);
......
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