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
508edcb6
Commit
508edcb6
authored
Apr 20, 2011
by
Konstantin Pavlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPNP: Don't strdup parameters to functions that accept const.
parent
b6f472ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
38 deletions
+10
-38
modules/services_discovery/upnp.cpp
modules/services_discovery/upnp.cpp
+10
-38
No files found.
modules/services_discovery/upnp.cpp
View file @
508edcb6
...
...
@@ -157,9 +157,7 @@ const char* xml_getChildElementValue( IXML_Element* p_parent,
if
(
!
p_parent
)
return
0
;
if
(
!
psz_tag_name_
)
return
0
;
char
*
psz_tag_name
=
strdup
(
psz_tag_name_
);
IXML_NodeList
*
p_node_list
=
ixmlElement_getElementsByTagName
(
p_parent
,
psz_tag_name
);
free
(
psz_tag_name
);
IXML_NodeList
*
p_node_list
=
ixmlElement_getElementsByTagName
(
p_parent
,
psz_tag_name_
);
if
(
!
p_node_list
)
return
0
;
IXML_Node
*
p_element
=
ixmlNodeList_item
(
p_node_list
,
0
);
...
...
@@ -212,11 +210,8 @@ IXML_Document* parseBrowseResult( IXML_Document* p_doc )
if
(
!
p_text_node
)
return
0
;
const
char
*
psz_result_string
=
ixmlNode_getNodeValue
(
p_text_node
);
char
*
psz_result_xml
=
strdup
(
psz_result_string
);
IXML_Document
*
p_browse_doc
=
ixmlParseBuffer
(
psz_result_xml
);
free
(
psz_result_xml
);
IXML_Document
*
p_browse_doc
=
ixmlParseBuffer
(
psz_result_string
);
return
p_browse_doc
;
}
...
...
@@ -442,18 +437,13 @@ void MediaServer::parseDeviceDescription( IXML_Document* p_doc,
strlen
(
psz_event_sub_url
)
+
1
);
if
(
psz_url
)
{
char
*
psz_s1
=
strdup
(
psz_base_url
);
char
*
psz_s2
=
strdup
(
psz_event_sub_url
);
if
(
UpnpResolveURL
(
psz_s1
,
psz_s2
,
psz_url
)
==
if
(
UpnpResolveURL
(
psz_base_url
,
psz_event_sub_url
,
psz_url
)
==
UPNP_E_SUCCESS
)
{
p_server
->
setContentDirectoryEventURL
(
psz_url
);
p_server
->
subscribeToContentDirectory
();
}
free
(
psz_s1
);
free
(
psz_s2
);
free
(
psz_url
);
}
...
...
@@ -463,18 +453,13 @@ void MediaServer::parseDeviceDescription( IXML_Document* p_doc,
strlen
(
psz_control_url
)
+
1
);
if
(
psz_url
)
{
char
*
psz_s1
=
strdup
(
psz_base_url
);
char
*
psz_s2
=
strdup
(
psz_control_url
);
if
(
UpnpResolveURL
(
psz_s1
,
psz_s2
,
psz_url
)
==
if
(
UpnpResolveURL
(
psz_base_url
,
psz_control_url
,
psz_url
)
==
UPNP_E_SUCCESS
)
{
p_server
->
setContentDirectoryControlURL
(
psz_url
);
p_server
->
fetchContents
();
}
free
(
psz_s1
);
free
(
psz_s2
);
free
(
psz_url
);
}
}
...
...
@@ -576,18 +561,12 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_,
return
0
;
}
char
*
psz_object_id
=
strdup
(
psz_object_id_
);
char
*
psz_browse_flag
=
strdup
(
psz_browser_flag_
);
char
*
psz_filter
=
strdup
(
psz_filter_
);
char
*
psz_starting_index
=
strdup
(
psz_starting_index_
);
char
*
psz_requested_count
=
strdup
(
psz_requested_count_
);
char
*
psz_sort_criteria
=
strdup
(
psz_sort_criteria_
);
char
*
psz_service_type
=
strdup
(
CONTENT_DIRECTORY_SERVICE_TYPE
);
int
i_res
;
i_res
=
UpnpAddToAction
(
&
p_action
,
"Browse"
,
psz_service_type
,
"ObjectID"
,
psz_object_id
);
psz_service_type
,
"ObjectID"
,
psz_object_id
_
);
if
(
i_res
!=
UPNP_E_SUCCESS
)
{
...
...
@@ -597,7 +576,7 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_,
}
i_res
=
UpnpAddToAction
(
&
p_action
,
"Browse"
,
psz_service_type
,
"BrowseFlag"
,
psz_browse
_flag
);
psz_service_type
,
"BrowseFlag"
,
psz_browse
r_flag_
);
if
(
i_res
!=
UPNP_E_SUCCESS
)
{
...
...
@@ -607,7 +586,7 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_,
}
i_res
=
UpnpAddToAction
(
&
p_action
,
"Browse"
,
psz_service_type
,
"Filter"
,
psz_filter
);
psz_service_type
,
"Filter"
,
psz_filter
_
);
if
(
i_res
!=
UPNP_E_SUCCESS
)
{
...
...
@@ -617,7 +596,7 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_,
}
i_res
=
UpnpAddToAction
(
&
p_action
,
"Browse"
,
psz_service_type
,
"StartingIndex"
,
psz_starting_index
);
psz_service_type
,
"StartingIndex"
,
psz_starting_index
_
);
if
(
i_res
!=
UPNP_E_SUCCESS
)
{
...
...
@@ -627,7 +606,7 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_,
}
i_res
=
UpnpAddToAction
(
&
p_action
,
"Browse"
,
psz_service_type
,
"RequestedCount"
,
psz_requested_count
);
psz_service_type
,
"RequestedCount"
,
psz_requested_count
_
);
if
(
i_res
!=
UPNP_E_SUCCESS
)
{
...
...
@@ -637,7 +616,7 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_,
}
i_res
=
UpnpAddToAction
(
&
p_action
,
"Browse"
,
psz_service_type
,
"SortCriteria"
,
psz_sort_criteria
);
psz_service_type
,
"SortCriteria"
,
psz_sort_criteria
_
);
if
(
i_res
!=
UPNP_E_SUCCESS
)
{
...
...
@@ -664,13 +643,6 @@ IXML_Document* MediaServer::_browseAction( const char* psz_object_id_,
browseActionCleanup:
free
(
psz_object_id
);
free
(
psz_browse_flag
);
free
(
psz_filter
);
free
(
psz_starting_index
);
free
(
psz_requested_count
);
free
(
psz_sort_criteria
);
free
(
psz_service_type
);
ixmlDocument_free
(
p_action
);
...
...
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