Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
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
libdvbpsi
Commits
8b0ba11b
Commit
8b0ba11b
authored
Mar 22, 2016
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SIS: resource leaks (CID #138522, #138523, #138524, #138527, #138528, #138529)
parent
24e5f213
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
+27
-7
src/tables/sis.c
src/tables/sis.c
+27
-7
No files found.
src/tables/sis.c
View file @
8b0ba11b
...
@@ -451,8 +451,9 @@ static dvbpsi_sis_cmd_splice_insert_t *
...
@@ -451,8 +451,9 @@ static dvbpsi_sis_cmd_splice_insert_t *
}
}
if
(
!
p_cmd
->
b_program_splice_flag
)
{
if
(
!
p_cmd
->
b_program_splice_flag
)
{
p_cmd
->
i_component_count
=
p_data
[
pos
];
p_cmd
->
i_component_count
=
p_data
[
pos
];
dvbpsi_sis_component_splice_time_t
*
p_
splice_time
=
p_cmd
->
p_splice_time
;
dvbpsi_sis_component_splice_time_t
*
p_
last
=
p_cmd
->
p_splice_time
;
for
(
uint8_t
i
=
0
;
i
<
p_cmd
->
i_component_count
;
i
++
)
{
for
(
uint8_t
i
=
0
;
i
<
p_cmd
->
i_component_count
;
i
++
)
{
dvbpsi_sis_component_splice_time_t
*
p_splice_time
;
p_splice_time
=
(
dvbpsi_sis_component_splice_time_t
*
)
p_splice_time
=
(
dvbpsi_sis_component_splice_time_t
*
)
calloc
(
1
,
sizeof
(
dvbpsi_sis_component_splice_time_t
));
calloc
(
1
,
sizeof
(
dvbpsi_sis_component_splice_time_t
));
if
(
!
p_splice_time
)
{
if
(
!
p_splice_time
)
{
...
@@ -476,7 +477,12 @@ static dvbpsi_sis_cmd_splice_insert_t *
...
@@ -476,7 +477,12 @@ static dvbpsi_sis_cmd_splice_insert_t *
else
else
pos
++
;
pos
++
;
}
}
p_splice_time
=
p_splice_time
->
p_next
;
if
(
!
p_cmd
->
p_splice_time
)
p_cmd
->
p_splice_time
=
p_last
=
p_splice_time
;
else
{
p_last
->
p_next
=
p_splice_time
;
p_last
=
p_last
->
p_next
;
}
/* Check if we have an overflow */
/* Check if we have an overflow */
assert
(
pos
<
i_length
);
assert
(
pos
<
i_length
);
}
}
...
@@ -539,8 +545,9 @@ static dvbpsi_sis_cmd_splice_schedule_t *
...
@@ -539,8 +545,9 @@ static dvbpsi_sis_cmd_splice_schedule_t *
uint32_t
pos
=
0
;
uint32_t
pos
=
0
;
p_cmd
->
i_splice_count
=
p_data
[
pos
++
];
p_cmd
->
i_splice_count
=
p_data
[
pos
++
];
dvbpsi_sis_splice_event_t
*
p_
even
t
=
p_cmd
->
p_splice_event
;
dvbpsi_sis_splice_event_t
*
p_
las
t
=
p_cmd
->
p_splice_event
;
for
(
uint8_t
i
=
0
;
i
<
p_cmd
->
i_splice_count
;
i
++
)
{
for
(
uint8_t
i
=
0
;
i
<
p_cmd
->
i_splice_count
;
i
++
)
{
dvbpsi_sis_splice_event_t
*
p_event
;
p_event
=
(
dvbpsi_sis_splice_event_t
*
)
calloc
(
1
,
sizeof
(
dvbpsi_sis_splice_event_t
));
p_event
=
(
dvbpsi_sis_splice_event_t
*
)
calloc
(
1
,
sizeof
(
dvbpsi_sis_splice_event_t
));
if
(
!
p_event
)
{
if
(
!
p_event
)
{
cmd_splice_schedule_cleanup
(
p_cmd
);
cmd_splice_schedule_cleanup
(
p_cmd
);
...
@@ -566,24 +573,32 @@ static dvbpsi_sis_cmd_splice_schedule_t *
...
@@ -566,24 +573,32 @@ static dvbpsi_sis_cmd_splice_schedule_t *
}
}
else
{
/* component */
else
{
/* component */
/* Check */
/* Check */
dvbpsi_sis_component_t
*
p_time
=
p_event
->
p_component
;
p_event
->
i_component_count
=
p_data
[
pos
++
];
p_event
->
i_component_count
=
p_data
[
pos
++
];
assert
(
pos
+
p_event
->
i_component_count
*
5
<
i_length
);
assert
(
pos
+
p_event
->
i_component_count
*
5
<
i_length
);
if
(
pos
+
p_event
->
i_component_count
*
5
>=
i_length
)
{
if
(
pos
+
p_event
->
i_component_count
*
5
>=
i_length
)
{
cmd_splice_schedule_cleanup
(
p_cmd
);
cmd_splice_schedule_cleanup
(
p_cmd
);
free
(
p_event
);
return
NULL
;
return
NULL
;
}
}
dvbpsi_sis_component_t
*
p_list
=
p_event
->
p_component
;
for
(
uint8_t
j
=
0
;
j
<
p_event
->
i_component_count
;
j
++
)
{
for
(
uint8_t
j
=
0
;
j
<
p_event
->
i_component_count
;
j
++
)
{
p_time
=
(
dvbpsi_sis_component_t
*
)
calloc
(
1
,
sizeof
(
dvbpsi_sis_component_t
));
dvbpsi_sis_component_t
*
p_time
;
p_time
=
(
dvbpsi_sis_component_t
*
)
calloc
(
1
,
sizeof
(
dvbpsi_sis_component_t
));
if
(
!
p_time
)
{
if
(
!
p_time
)
{
cmd_splice_schedule_cleanup
(
p_cmd
);
cmd_splice_schedule_cleanup
(
p_cmd
);
free
(
p_event
);
return
NULL
;
return
NULL
;
}
}
p_time
->
i_tag
=
p_data
[
pos
++
];
p_time
->
i_tag
=
p_data
[
pos
++
];
p_time
->
i_utc_splice_time
=
p_data
[
pos
];
/* GPS_UTC time */
p_time
->
i_utc_splice_time
=
p_data
[
pos
];
/* GPS_UTC time */
pos
+=
4
;
pos
+=
4
;
p_time
=
p_time
->
p_next
;
if
(
!
p_event
->
p_component
)
p_event
->
p_component
=
p_list
=
p_time
;
else
{
p_list
->
p_next
=
p_time
;
p_list
=
p_list
->
p_next
;
}
}
}
}
}
if
(
p_event
->
b_duration_flag
)
{
if
(
p_event
->
b_duration_flag
)
{
...
@@ -603,7 +618,12 @@ static dvbpsi_sis_cmd_splice_schedule_t *
...
@@ -603,7 +618,12 @@ static dvbpsi_sis_cmd_splice_schedule_t *
p_event
->
i_avails_expected
=
p_data
[
pos
++
];
p_event
->
i_avails_expected
=
p_data
[
pos
++
];
}
}
p_event
=
p_event
->
p_next
;
if
(
!
p_cmd
->
p_splice_event
)
p_cmd
->
p_splice_event
=
p_last
=
p_event
;
else
{
p_last
->
p_next
=
p_event
;
p_last
=
p_last
->
p_next
;
}
/* Check if we have an overflow */
/* Check if we have an overflow */
assert
(
pos
<
i_length
);
assert
(
pos
<
i_length
);
...
...
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