Commit 815b532b authored by David Hedberg's avatar David Hedberg Committed by Alexandre Julliard

shell32: Always initialize shellitem to NULL in SHCreateShellItem.

parent 9ff68534
......@@ -555,6 +555,8 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
TRACE("(%p,%p,%p,%p)\n", pidlParent, psfParent, pidl, ppsi);
*ppsi = NULL;
if (!pidl)
{
return E_INVALIDARG;
......@@ -604,7 +606,6 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
}
else
{
*ppsi = NULL;
ILFree(new_pidl);
}
return ret;
......
......@@ -2236,8 +2236,10 @@ static void test_SHCreateShellItem(void)
pidl_abstestfile = pILCombine(pidl_cwd, pidl_testfile);
shellitem = (void*)0xdeadbeef;
ret = pSHCreateShellItem(NULL, NULL, NULL, &shellitem);
ok(ret == E_INVALIDARG, "SHCreateShellItem returned %x\n", ret);
ok(shellitem == 0, "Got %p\n", shellitem);
if (0) /* crashes on Windows XP */
{
......
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