Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3804b99e
Commit
3804b99e
authored
Feb 06, 2019
by
Sven Baars
Committed by
Alexandre Julliard
Feb 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Fix some memory leaks on error path (Valgrind).
Signed-off-by:
Sven Baars
<
sven.wine@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
48e6f8f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
task.c
dlls/mstask/task.c
+14
-7
No files found.
dlls/mstask/task.c
View file @
3804b99e
...
@@ -1690,7 +1690,11 @@ static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR ta
...
@@ -1690,7 +1690,11 @@ static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR ta
hfile
=
CreateFileW
(
task_name
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
disposition
,
0
,
0
);
hfile
=
CreateFileW
(
task_name
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
disposition
,
0
,
0
);
if
(
hfile
!=
INVALID_HANDLE_VALUE
)
break
;
if
(
hfile
!=
INVALID_HANDLE_VALUE
)
break
;
if
(
try
++
>=
3
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
if
(
try
++
>=
3
)
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
failed
;
}
Sleep
(
100
);
Sleep
(
100
);
}
}
...
@@ -1781,13 +1785,16 @@ failed:
...
@@ -1781,13 +1785,16 @@ failed:
CoTaskMemFree
(
comment
);
CoTaskMemFree
(
comment
);
CoTaskMemFree
(
user_data
);
CoTaskMemFree
(
user_data
);
CloseHandle
(
hfile
);
if
(
hfile
!=
INVALID_HANDLE_VALUE
)
if
(
hr
!=
S_OK
)
DeleteFileW
(
task_name
);
else
if
(
remember
)
{
{
heap_free
(
This
->
task_name
);
CloseHandle
(
hfile
);
This
->
task_name
=
heap_strdupW
(
task_name
);
if
(
hr
!=
S_OK
)
DeleteFileW
(
task_name
);
else
if
(
remember
)
{
heap_free
(
This
->
task_name
);
This
->
task_name
=
heap_strdupW
(
task_name
);
}
}
}
return
hr
;
return
hr
;
}
}
...
...
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