[vlc-commits] demux: wpl: fix leak on repeated attributes (cid #1313808)

Francois Cartegnie git at videolan.org
Fri Jan 1 18:17:55 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan  1 18:01:40 2016 +0100| [f9fcc8bcc9da9845c1ab25c4814dc8c967e823f9] | committer: Francois Cartegnie

demux: wpl: fix leak on repeated attributes (cid #1313808)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f9fcc8bcc9da9845c1ab25c4814dc8c967e823f9
---

 modules/demux/playlist/wpl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/playlist/wpl.c b/modules/demux/playlist/wpl.c
index 66fc2e3..9164e69 100644
--- a/modules/demux/playlist/wpl.c
+++ b/modules/demux/playlist/wpl.c
@@ -56,9 +56,9 @@ static void read_head( demux_t* p_demux, input_item_t* p_input )
                 psz_attr = xml_ReaderNextAttr( p_sys->p_reader, &psz_val );
                 if ( !psz_attr || !psz_val )
                     break;
-                if ( !strcasecmp( psz_attr, "name" ) )
+                if ( !strcasecmp( psz_attr, "name" ) && !psz_attribute_name )
                     psz_attribute_name = strdup( psz_val );
-                else if ( !strcasecmp( psz_attr, "content" ) )
+                else if ( !strcasecmp( psz_attr, "content" ) && !psz_attribute_value )
                     psz_attribute_value = strdup( psz_val );
             }
             if ( psz_attribute_name && psz_attribute_value )



More information about the vlc-commits mailing list