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
261fd89d
Commit
261fd89d
authored
May 10, 2008
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check malloc return value and cleanup if allocation failed.
parent
38aaaeb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
modules/access/rtmp/rtmp_amf_flv.c
modules/access/rtmp/rtmp_amf_flv.c
+18
-4
No files found.
modules/access/rtmp/rtmp_amf_flv.c
View file @
261fd89d
...
...
@@ -430,7 +430,12 @@ rtmp_connect_active( rtmp_control_thread_t *p_thread )
free
(
tmp_buffer
);
tmp_url
=
(
char
*
)
malloc
(
strlen
(
"rtmp://"
)
+
strlen
(
p_thread
->
url
.
psz_buffer
)
+
1
);
/* FIXME: Handle error case when malloc FAILS */
if
(
!
tmp_url
)
{
free
(
rtmp_body
->
body
);
free
(
rtmp_body
);
return
-
1
;
}
sprintf
(
tmp_url
,
"rtmp://%s"
,
p_thread
->
url
.
psz_buffer
);
tmp_buffer
=
amf_encode_object_variable
(
"tcUrl"
,
AMF_DATATYPE_STRING
,
tmp_url
);
...
...
@@ -1853,8 +1858,12 @@ rtmp_encode_NetStream_play_reset_onStatus( rtmp_control_thread_t *p_thread, char
free
(
tmp_buffer
);
description
=
(
char
*
)
malloc
(
strlen
(
"Playing and resetting "
)
+
strlen
(
psz_media
)
+
strlen
(
"."
)
+
1
);
/* FIXME: Handle error case when malloc FAILS */
if
(
!
description
)
{
free
(
rtmp_body
->
body
);
free
(
rtmp_body
);
return
NULL
;
}
sprintf
(
description
,
"Playing and resetting %s."
,
psz_media
);
tmp_buffer
=
amf_encode_object_variable
(
"description"
,
AMF_DATATYPE_STRING
,
description
);
...
...
@@ -1935,7 +1944,12 @@ rtmp_encode_NetStream_play_start_onStatus( rtmp_control_thread_t *p_thread, char
free
(
tmp_buffer
);
description
=
(
char
*
)
malloc
(
strlen
(
"Started playing "
)
+
strlen
(
psz_media
)
+
strlen
(
"."
)
+
1
);
/* FIXME: Handle error case when MALLOC FAILS */
if
(
!
description
)
{
free
(
rtmp_body
->
body
);
free
(
rtmp_body
);
return
NULL
;
}
sprintf
(
description
,
"Started playing %s."
,
psz_media
);
tmp_buffer
=
amf_encode_object_variable
(
"description"
,
...
...
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