Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ffd84dc4
Commit
ffd84dc4
authored
Apr 01, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Fix some leaks on error paths (Coverity).
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
855d7b0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
20 deletions
+26
-20
filedlgbrowser.c
dlls/comdlg32/filedlgbrowser.c
+26
-20
No files found.
dlls/comdlg32/filedlgbrowser.c
View file @
ffd84dc4
...
...
@@ -334,7 +334,7 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
UINT
wFlags
)
{
HRESULT
hRes
;
IShellFolder
*
psfTmp
;
IShellFolder
*
folder
;
IShellView
*
psvTmp
;
FileOpenDlgInfos
*
fodInfos
;
LPITEMIDLIST
pidlTmp
;
...
...
@@ -355,8 +355,8 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
{
/* SBSP_RELATIVE A relative pidl (relative from the current folder) */
if
(
FAILED
(
hRes
=
IShellFolder_BindToObject
(
fodInfos
->
Shell
.
FOIShellFolder
,
pidl
,
NULL
,
&
IID_IShellFolder
,
(
LPVOID
*
)
&
psfTmp
)))
if
(
FAILED
(
hRes
=
IShellFolder_BindToObject
(
fodInfos
->
Shell
.
FOIShellFolder
,
pidl
,
NULL
,
&
IID_IShellFolder
,
(
void
**
)
&
folder
)))
{
ERR
(
"bind to object failed
\n
"
);
return
hRes
;
...
...
@@ -368,30 +368,30 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
{
/* Browse the parent folder (ignores the pidl) */
pidlTmp
=
GetParentPidl
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
);
psfTmp
=
GetShellFolderFromPidl
(
pidlTmp
);
folder
=
GetShellFolderFromPidl
(
pidlTmp
);
}
else
/* SBSP_ABSOLUTE is 0x0000 */
{
/* An absolute pidl (relative from the desktop) */
pidlTmp
=
ILClone
(
pidl
);
psfTmp
=
GetShellFolderFromPidl
(
pidlTmp
);
folder
=
GetShellFolderFromPidl
(
pidlTmp
);
}
if
(
!
psfTmp
)
if
(
!
folder
)
{
ERR
(
"could not browse to folder
\n
"
);
return
E_FAIL
;
ERR
(
"could not browse to folder
\n
"
);
ILFree
(
pidlTmp
);
return
E_FAIL
;
}
/* If the pidl to browse to is equal to the actual pidl ...
do nothing and pretend you did it*/
if
(
ILIsEqual
(
pidlTmp
,
fodInfos
->
ShellInfos
.
pidlAbsCurrent
))
{
IShellFolder_Release
(
psfTmp
);
IShellFolder_Release
(
folder
);
ILFree
(
pidlTmp
);
TRACE
(
"keep current folder
\n
"
);
return
NOERROR
;
return
S_OK
;
}
/* Release the current DataObject */
...
...
@@ -403,8 +403,13 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
/* Create the associated view */
TRACE
(
"create view object
\n
"
);
if
(
FAILED
(
hRes
=
IShellFolder_CreateViewObject
(
psfTmp
,
fodInfos
->
ShellInfos
.
hwndOwner
,
&
IID_IShellView
,
(
LPVOID
*
)
&
psvTmp
)))
goto
error
;
if
(
FAILED
(
hRes
=
IShellFolder_CreateViewObject
(
folder
,
fodInfos
->
ShellInfos
.
hwndOwner
,
&
IID_IShellView
,
(
void
**
)
&
psvTmp
)))
{
IShellFolder_Release
(
folder
);
ILFree
(
pidlTmp
);
return
hRes
;
}
/* Check if listview has focus */
bViewHasFocus
=
IsChild
(
fodInfos
->
ShellInfos
.
hwndView
,
GetFocus
());
...
...
@@ -426,7 +431,7 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
/* Release old FOIShellFolder and update its value */
if
(
fodInfos
->
Shell
.
FOIShellFolder
)
IShellFolder_Release
(
fodInfos
->
Shell
.
FOIShellFolder
);
fodInfos
->
Shell
.
FOIShellFolder
=
psfTmp
;
fodInfos
->
Shell
.
FOIShellFolder
=
folder
;
/* Release old pidlAbsCurrent and update its value */
ILFree
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
);
...
...
@@ -439,9 +444,13 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
/* Create the window */
TRACE
(
"create view window
\n
"
);
if
(
FAILED
(
hRes
=
IShellView_CreateViewWindow
(
psvTmp
,
NULL
,
&
fodInfos
->
ShellInfos
.
folderSettings
,
fodInfos
->
Shell
.
FOIShellBrowser
,
&
rectView
,
&
hwndView
)))
goto
error
;
if
(
FAILED
(
hRes
=
IShellView_CreateViewWindow
(
psvTmp
,
NULL
,
&
fodInfos
->
ShellInfos
.
folderSettings
,
fodInfos
->
Shell
.
FOIShellBrowser
,
&
rectView
,
&
hwndView
)))
{
WARN
(
"Failed to create view window, hr %#x.
\n
"
,
hRes
);
return
hRes
;
}
fodInfos
->
ShellInfos
.
hwndView
=
hwndView
;
...
...
@@ -461,9 +470,6 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
SetFocus
(
fodInfos
->
ShellInfos
.
hwndView
);
return
hRes
;
error:
ERR
(
"Failed with error 0x%08x
\n
"
,
hRes
);
return
hRes
;
}
/**************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment