Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
7d3cc85d
Commit
7d3cc85d
authored
Mar 15, 2008
by
Richard Hosking
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix very minor memory leak when using OSS for audio.
parent
a19cac21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
modules/access/v4l2/v4l2.c
modules/access/v4l2/v4l2.c
+9
-6
No files found.
modules/access/v4l2/v4l2.c
View file @
7d3cc85d
...
...
@@ -2451,13 +2451,12 @@ static int OpenAudioDevAlsa( vlc_object_t *p_this, demux_sys_t *p_sys,
static
int
OpenAudioDevOss
(
vlc_object_t
*
p_this
,
demux_sys_t
*
p_sys
,
vlc_bool_t
b_demux
)
{
char
*
psz_device
=
p_sys
->
psz_adev
;
int
i_fd
=
0
;
int
i_format
;
/* OSS */
if
(
!
psz_device
)
psz_device
=
strdup
(
OSS_DEFAULT
);
/* FIXME leak */
char
*
psz_oss_device_name
=
strdup
(
(
!
p_sys
->
psz_adev
)
?
OSS_DEFAULT
:
p_sys
->
psz_adev
);
if
(
(
i_fd
=
open
(
psz_
devic
e
,
O_RDONLY
|
O_NONBLOCK
))
<
0
)
if
(
(
i_fd
=
open
(
psz_
oss_device_nam
e
,
O_RDONLY
|
O_NONBLOCK
))
<
0
)
{
msg_Err
(
p_this
,
"cannot open OSS audio device (%m)"
);
goto
adev_fail
;
...
...
@@ -2490,10 +2489,12 @@ static int OpenAudioDevOss( vlc_object_t *p_this, demux_sys_t *p_sys,
if
(
!
p_sys
->
psz_adev
)
p_sys
->
psz_adev
=
strdup
(
OSS_DEFAULT
);
free
(
psz_oss_device_name
);
return
i_fd
;
adev_fail:
free
(
psz_oss_device_name
);
if
(
i_fd
>=
0
)
close
(
i_fd
);
return
-
1
;
...
...
@@ -2893,11 +2894,11 @@ static vlc_bool_t ProbeAudioDevOss( vlc_object_t *p_this, demux_sys_t *p_sys,
{
int
i_fd
=
0
;
int
i_caps
;
if
(
!
psz_device
)
psz_device
=
strdup
(
OSS_DEFAULT
);
/* FIXME leak */
char
*
psz_oss_device_name
=
strdup
(
(
!
psz_device
)
?
OSS_DEFAULT
:
psz_device
);
if
(
(
i_fd
=
open
(
psz_
devic
e
,
O_RDONLY
|
O_NONBLOCK
)
)
<
0
)
if
(
(
i_fd
=
open
(
psz_
oss_device_nam
e
,
O_RDONLY
|
O_NONBLOCK
)
)
<
0
)
{
msg_Err
(
p_this
,
"cannot open device %s for OSS audio (%m)"
,
psz_
devic
e
);
msg_Err
(
p_this
,
"cannot open device %s for OSS audio (%m)"
,
psz_
oss_device_nam
e
);
goto
open_failed
;
}
...
...
@@ -2908,11 +2909,13 @@ static vlc_bool_t ProbeAudioDevOss( vlc_object_t *p_this, demux_sys_t *p_sys,
goto
open_failed
;
}
free
(
psz_oss_device_name
);
if
(
i_fd
>=
0
)
close
(
i_fd
);
return
VLC_TRUE
;
open_failed:
free
(
psz_oss_device_name
);
if
(
i_fd
>=
0
)
close
(
i_fd
);
return
VLC_FALSE
;
}
...
...
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