Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e7832276
Commit
e7832276
authored
Aug 04, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix potential memleaks.
parent
60564df6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
modules/visualization/visual/effects.c
modules/visualization/visual/effects.c
+9
-10
No files found.
modules/visualization/visual/effects.c
View file @
e7832276
...
@@ -391,10 +391,7 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
...
@@ -391,10 +391,7 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
p_buffer
->
i_nb_samples
*
p_effect
->
i_nb_chans
*
sizeof
(
int16_t
));
p_buffer
->
i_nb_samples
*
p_effect
->
i_nb_chans
*
sizeof
(
int16_t
));
if
(
!
p_s16_buff
)
if
(
!
p_s16_buff
)
{
msg_Err
(
p_aout
,
"out of memory"
);
return
-
1
;
return
-
1
;
}
p_buffs
=
p_s16_buff
;
p_buffs
=
p_s16_buff
;
i_original
=
config_GetInt
(
p_aout
,
"spect-show-original"
);
i_original
=
config_GetInt
(
p_aout
,
"spect-show-original"
);
...
@@ -423,14 +420,14 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
...
@@ -423,14 +420,14 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
if
(
!
p_effect
->
p_data
)
if
(
!
p_effect
->
p_data
)
{
{
p_effect
->
p_data
=
(
void
*
)
malloc
(
i_nb_bands
*
sizeof
(
int
)
);
p_effect
->
p_data
=
(
void
*
)
malloc
(
i_nb_bands
*
sizeof
(
int
)
);
if
(
!
p_effect
->
p_data
)
if
(
!
p_effect
->
p_data
)
{
{
msg_Err
(
p_aout
,
"out of memory"
);
free
(
p_s16_buff
);
return
-
1
;
return
-
1
;
}
}
peaks
=
(
int
*
)
p_effect
->
p_data
;
peaks
=
(
int
*
)
p_effect
->
p_data
;
for
(
i
=
0
;
i
<
i_nb_bands
;
i
++
)
for
(
i
=
0
;
i
<
i_nb_bands
;
i
++
)
{
{
peaks
[
i
]
=
0
;
peaks
[
i
]
=
0
;
}
}
...
@@ -443,7 +440,8 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
...
@@ -443,7 +440,8 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
height
=
(
int
*
)
malloc
(
i_nb_bands
*
sizeof
(
int
)
);
height
=
(
int
*
)
malloc
(
i_nb_bands
*
sizeof
(
int
)
);
if
(
!
height
)
if
(
!
height
)
{
{
msg_Err
(
p_aout
,
"out of memory"
);
free
(
p_effect
->
p_data
);
free
(
p_s16_buff
);
return
-
1
;
return
-
1
;
}
}
...
@@ -463,6 +461,9 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
...
@@ -463,6 +461,9 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
if
(
!
p_state
)
if
(
!
p_state
)
{
{
msg_Err
(
p_aout
,
"unable to initialize FFT transform"
);
msg_Err
(
p_aout
,
"unable to initialize FFT transform"
);
free
(
height
);
free
(
p_effect
->
p_data
);
free
(
p_s16_buff
);
return
-
1
;
return
-
1
;
}
}
p_buffs
=
p_s16_buff
;
p_buffs
=
p_s16_buff
;
...
@@ -766,8 +767,6 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
...
@@ -766,8 +767,6 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
fft_close
(
p_state
);
fft_close
(
p_state
);
free
(
p_s16_buff
);
free
(
p_s16_buff
);
p_s16_buff
=
NULL
;
free
(
height
);
free
(
height
);
return
0
;
return
0
;
...
...
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