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
f8031d06
Commit
f8031d06
authored
Mar 12, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schedsvc: Fix xml buffer leak (Valgrind).
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d03bef8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
schedsvc.c
dlls/schedsvc/schedsvc.c
+10
-5
No files found.
dlls/schedsvc/schedsvc.c
View file @
f8031d06
...
...
@@ -259,9 +259,10 @@ static int detect_encoding(const void *buffer, DWORD size)
static
HRESULT
read_xml
(
const
WCHAR
*
name
,
WCHAR
**
xml
)
{
char
*
src
,
*
buff
;
HANDLE
hfile
;
DWORD
size
,
attrs
;
char
*
src
;
HRESULT
hr
=
S_OK
;
int
cp
;
attrs
=
GetFileAttributesW
(
name
);
...
...
@@ -275,7 +276,7 @@ static HRESULT read_xml(const WCHAR *name, WCHAR **xml)
return
HRESULT_FROM_WIN32
(
GetLastError
());
size
=
GetFileSize
(
hfile
,
NULL
);
src
=
heap_alloc
(
size
+
2
);
buff
=
src
=
heap_alloc
(
size
+
2
);
if
(
!
src
)
{
CloseHandle
(
hfile
);
...
...
@@ -300,9 +301,13 @@ static HRESULT read_xml(const WCHAR *name, WCHAR **xml)
size
=
MultiByteToWideChar
(
cp
,
0
,
src
,
-
1
,
NULL
,
0
);
*
xml
=
heap_alloc
(
size
*
sizeof
(
WCHAR
));
if
(
!*
xml
)
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
cp
,
0
,
src
,
-
1
,
*
xml
,
size
);
return
S_OK
;
if
(
*
xml
)
MultiByteToWideChar
(
cp
,
0
,
src
,
-
1
,
*
xml
,
size
);
else
hr
=
E_OUTOFMEMORY
;
heap_free
(
buff
);
return
hr
;
}
HRESULT
__cdecl
SchRpcRetrieveTask
(
const
WCHAR
*
path
,
const
WCHAR
*
languages
,
ULONG
*
n_languages
,
WCHAR
**
xml
)
...
...
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