Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
c741c175
Commit
c741c175
authored
Aug 15, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use asprintf instead of malloc+sprintf, check the return value and remove unneeded FREENULL.
parent
6a0fc815
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
modules/demux/playlist/shoutcast.c
modules/demux/playlist/shoutcast.c
+18
-18
No files found.
modules/demux/playlist/shoutcast.c
View file @
c741c175
...
...
@@ -224,17 +224,17 @@ static int DemuxGenre( demux_t *p_demux )
if
(
!
psz_eltname
)
return
-
1
;
if
(
!
strcmp
(
psz_eltname
,
"genre"
)
)
{
char
*
psz_mrl
=
malloc
(
strlen
(
SHOUTCAST_BASE_URL
)
+
strlen
(
"?genre="
)
+
strlen
(
psz_name
)
+
1
);
sprintf
(
psz_mrl
,
SHOUTCAST_BASE_URL
"?genre=%s"
,
psz_name
);
p_input
=
input_item_
NewExt
(
p_demux
,
psz_mrl
,
char
*
psz_mrl
;
if
(
asprintf
(
&
psz_mrl
,
SHOUTCAST_BASE_URL
"?genre=%s"
,
psz_name
)
!=
-
1
)
{
p_input
=
input_Item
NewExt
(
p_demux
,
psz_mrl
,
psz_name
,
0
,
NULL
,
-
1
);
input_item_CopyOptions
(
p_sys
->
p_current_input
,
p_input
);
input_ItemCopyOptions
(
p_sys
->
p_current_input
,
p_input
);
free
(
psz_mrl
);
input_item_
AddSubItem
(
p_sys
->
p_current_input
,
p_input
);
input_Item
AddSubItem
(
p_sys
->
p_current_input
,
p_input
);
vlc_gc_decref
(
p_input
);
}
FREENULL
(
psz_name
);
}
FREENULL
(
psz_eltname
);
...
...
@@ -318,9 +318,9 @@ static int DemuxStation( demux_t *p_demux )
xml_ReaderValue
(
p_sys
->
p_xml_reader
);
if
(
!
psz_attrname
||
!
psz_attrvalue
)
{
free
(
psz_eltname
);
FREENULL
(
psz_attrname
);
FREENULL
(
psz_attrvalue
);
free
(
psz_eltname
);
free
(
psz_attrname
);
free
(
psz_attrvalue
);
return
-
1
;
}
...
...
@@ -344,9 +344,9 @@ static int DemuxStation( demux_t *p_demux )
xml_ReaderValue
(
p_sys
->
p_xml_reader
);
if
(
!
psz_attrname
||
!
psz_attrvalue
)
{
free
(
psz_eltname
);
FREENULL
(
psz_attrname
);
FREENULL
(
psz_attrvalue
);
free
(
psz_eltname
);
free
(
psz_attrname
);
free
(
psz_attrvalue
);
return
-
1
;
}
...
...
@@ -369,7 +369,7 @@ static int DemuxStation( demux_t *p_demux )
free
(
psz_attrvalue
);
}
}
free
(
psz_eltname
);
free
(
psz_eltname
);
break
;
case
XML_READER_TEXT
:
...
...
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