Commit 8348ef44 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: xspf: fix leaks with unwanted attributes (cid #1253106)

parent 2b24884f
...@@ -626,6 +626,7 @@ static bool parse_extension_node COMPLEX_INTERFACE ...@@ -626,6 +626,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
{ {
if (!psz_title) if (!psz_title)
{ {
free(psz_application);
msg_Warn(p_demux, "<vlc:node> requires \"title\" attribute"); msg_Warn(p_demux, "<vlc:node> requires \"title\" attribute");
return false; return false;
} }
...@@ -639,12 +640,12 @@ static bool parse_extension_node COMPLEX_INTERFACE ...@@ -639,12 +640,12 @@ static bool parse_extension_node COMPLEX_INTERFACE
p_input_item = p_new_input; p_input_item = p_new_input;
b_release_input_item = true; b_release_input_item = true;
} }
free(psz_title);
} }
else if (!strcmp(psz_element, "extension")) else if (!strcmp(psz_element, "extension"))
{ {
if (!psz_application) if (!psz_application)
{ {
free(psz_title);
msg_Warn(p_demux, "<extension> requires \"application\" attribute"); msg_Warn(p_demux, "<extension> requires \"application\" attribute");
return false; return false;
} }
...@@ -654,6 +655,7 @@ static bool parse_extension_node COMPLEX_INTERFACE ...@@ -654,6 +655,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
{ {
msg_Dbg(p_demux, "Skipping \"%s\" extension tag", psz_application); msg_Dbg(p_demux, "Skipping \"%s\" extension tag", psz_application);
free(psz_application); free(psz_application);
free(psz_title);
/* Skip all children */ /* Skip all children */
for (unsigned lvl = 1; lvl;) for (unsigned lvl = 1; lvl;)
switch (xml_ReaderNextNode(p_xml_reader, NULL)) switch (xml_ReaderNextNode(p_xml_reader, NULL))
...@@ -666,7 +668,7 @@ static bool parse_extension_node COMPLEX_INTERFACE ...@@ -666,7 +668,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
} }
} }
free(psz_application); free(psz_application);
free(psz_title);
/* parse the child elements */ /* parse the child elements */
while ((i_node = xml_ReaderNextNode(p_xml_reader, &name)) > 0) while ((i_node = xml_ReaderNextNode(p_xml_reader, &name)) > 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment