[vlc-devel] commit: Fix memleak with malformatted RSS input. ( Rémi Duraffort )

git version control git at videolan.org
Fri Aug 15 21:54:40 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Aug 15 09:25:02 2008 +0200| [2b0814abd0934d3577bd5ee287aefcb1f5b7ca52] | committer: Rémi Duraffort 

Fix memleak with malformatted RSS input.

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

 modules/video_filter/rss.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/modules/video_filter/rss.c b/modules/video_filter/rss.c
index 70bbdf1..9e708e4 100644
--- a/modules/video_filter/rss.c
+++ b/modules/video_filter/rss.c
@@ -744,7 +744,6 @@ static int FetchRSS( filter_t *p_filter)
 
                 case XML_READER_STARTELEM:
                     free( psz_eltname );
-                    psz_eltname = NULL;
                     psz_eltname = xml_ReaderName( p_xml_reader );
                     if( !psz_eltname )
                     {
@@ -779,10 +778,20 @@ static int FetchRSS( filter_t *p_filter)
                             char *psz_value = xml_ReaderValue( p_xml_reader );
                             if( !strcmp( psz_name, "rel" ) )
                             {
+                                if( psz_rel )
+                                {
+                                    msg_Dbg( p_filter, "\"rel\" attribute of link atom duplicated (last value: %s)", psz_value );
+                                    free( psz_rel );
+                                }
                                 psz_rel = psz_value;
                             }
                             else if( !strcmp( psz_name, "href" ) )
                             {
+                                if( psz_href )
+                                {
+                                    msg_Dbg( p_filter, "\"href\" attribute of link atom duplicated (last value: %s)", psz_href );
+                                    free( psz_href );
+                                }
                                 psz_href = psz_value;
                             }
                             else




More information about the vlc-devel mailing list