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
a410e056
Commit
a410e056
authored
Jul 14, 2015
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input stats: handle malloc error
parent
6d2a3a9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/input/stats.c
src/input/stats.c
+6
-0
No files found.
src/input/stats.c
View file @
a410e056
...
...
@@ -174,6 +174,9 @@ void stats_Update( counter_t *p_counter, uint64_t val, uint64_t *new_val )
p_counter
->
last_update
=
now
;
/* Insert the new one at the beginning */
p_new
=
(
counter_sample_t
*
)
malloc
(
sizeof
(
counter_sample_t
)
);
if
(
unlikely
(
p_new
==
NULL
))
return
;
/* NOTE: Losing sample here */
p_new
->
value
=
val
;
p_new
->
date
=
p_counter
->
last_update
;
INSERT_ELEM
(
p_counter
->
pp_samples
,
p_counter
->
i_samples
,
...
...
@@ -192,6 +195,9 @@ void stats_Update( counter_t *p_counter, uint64_t val, uint64_t *new_val )
{
counter_sample_t
*
p_new
=
(
counter_sample_t
*
)
malloc
(
sizeof
(
counter_sample_t
)
);
if
(
unlikely
(
p_new
==
NULL
))
return
;
/* NOTE: Losing sample here */
p_new
->
value
=
0
;
INSERT_ELEM
(
p_counter
->
pp_samples
,
p_counter
->
i_samples
,
...
...
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