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
c39121fc
Commit
c39121fc
authored
Jun 21, 2017
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Fix a memory leak.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
01439ef5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
dsound_main.c
dlls/dsound/dsound_main.c
+1
-1
dsound_private.h
dlls/dsound/dsound_private.h
+14
-1
propset.c
dlls/dsound/propset.c
+5
-7
No files found.
dlls/dsound/dsound_main.c
View file @
c39121fc
...
...
@@ -89,7 +89,7 @@ CRITICAL_SECTION DSOUND_capturers_lock = { &DSOUND_capturers_lock_debug, -1, 0,
GUID
DSOUND_renderer_guids
[
MAXWAVEDRIVERS
];
GUID
DSOUND_capture_guids
[
MAXWAVEDRIVERS
];
WCHAR
wine_vxd_drv
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
'm'
,
'm'
,
'.'
,
'v'
,
'x'
,
'd'
,
0
};
const
WCHAR
wine_vxd_drv
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
'm'
,
'm'
,
'.'
,
'v'
,
'x'
,
'd'
,
0
};
/* All default settings, you most likely don't want to touch these, see wiki on UsefulRegistryKeys */
int
ds_hel_buflen
=
32768
*
2
;
...
...
dlls/dsound/dsound_private.h
View file @
c39121fc
...
...
@@ -31,6 +31,7 @@
#include "uuids.h"
#include "wine/list.h"
#include "wine/unicode.h"
#define DS_MAX_CHANNELS 6
...
...
@@ -254,7 +255,7 @@ extern struct list DSOUND_renderers DECLSPEC_HIDDEN;
extern
GUID
DSOUND_renderer_guids
[
MAXWAVEDRIVERS
]
DECLSPEC_HIDDEN
;
extern
GUID
DSOUND_capture_guids
[
MAXWAVEDRIVERS
]
DECLSPEC_HIDDEN
;
extern
WCHAR
wine_vxd_drv
[]
DECLSPEC_HIDDEN
;
extern
const
WCHAR
wine_vxd_drv
[]
DECLSPEC_HIDDEN
;
void
setup_dsound_options
(
void
)
DECLSPEC_HIDDEN
;
...
...
@@ -264,3 +265,15 @@ BOOL DSOUND_check_supported(IAudioClient *client, DWORD rate,
DWORD
depth
,
WORD
channels
)
DECLSPEC_HIDDEN
;
HRESULT
enumerate_mmdevices
(
EDataFlow
flow
,
GUID
*
guids
,
LPDSENUMCALLBACKW
cb
,
void
*
user
)
DECLSPEC_HIDDEN
;
static
inline
WCHAR
*
strdupW
(
const
WCHAR
*
str
)
{
size_t
size
;
WCHAR
*
ret
;
if
(
!
str
)
return
NULL
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
return
ret
;
}
dlls/dsound/propset.c
View file @
c39121fc
...
...
@@ -200,7 +200,6 @@ static HRESULT DSPROPERTY_DescriptionW(
IMMDevice
*
mmdevice
;
IPropertyStore
*
ps
;
PROPVARIANT
pv
;
DWORD
desclen
;
HRESULT
hr
;
TRACE
(
"pPropData=%p,cbPropData=%d,pcbReturned=%p)
\n
"
,
...
...
@@ -248,12 +247,9 @@ static HRESULT DSPROPERTY_DescriptionW(
return
hr
;
}
desclen
=
lstrlenW
(
pv
.
u
.
pwszVal
)
+
1
;
/* FIXME: Still a memory leak.. */
ppd
->
Description
=
HeapAlloc
(
GetProcessHeap
(),
0
,
desclen
*
sizeof
(
WCHAR
));
memcpy
(
ppd
->
Description
,
pv
.
u
.
pwszVal
,
desclen
*
sizeof
(
WCHAR
));
ppd
->
Module
=
wine_vxd_drv
;
ppd
->
Interface
=
wInterface
;
ppd
->
Description
=
strdupW
(
pv
.
u
.
pwszVal
);
ppd
->
Module
=
strdupW
(
wine_vxd_drv
);
ppd
->
Interface
=
strdupW
(
wInterface
);
ppd
->
Type
=
DIRECTSOUNDDEVICE_TYPE_VXD
;
PropVariantClear
(
&
pv
);
...
...
@@ -463,6 +459,7 @@ static HRESULT DSPROPERTY_DescriptionA(
return
hr
;
if
(
!
DSPROPERTY_descWtoA
(
&
data
,
ppd
))
hr
=
E_OUTOFMEMORY
;
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Description
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Module
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Interface
);
return
hr
;
...
...
@@ -488,6 +485,7 @@ static HRESULT DSPROPERTY_Description1(
if
(
FAILED
(
hr
))
return
hr
;
DSPROPERTY_descWto1
(
&
data
,
ppd
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Description
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Module
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Interface
);
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