[vlc-devel] commit: podcast: no need to strdup the string here. ( Rémi Duraffort )

git version control git at videolan.org
Fri Jul 31 08:32:35 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Jul 31 08:30:41 2009 +0200| [937fa424a97fb62e22fa62c771ea7cb087e03a25] | committer: Rémi Duraffort 

podcast: no need to strdup the string here.

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

 modules/demux/playlist/podcast.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/demux/playlist/podcast.c b/modules/demux/playlist/podcast.c
index bcdd0ed..137f9e1 100644
--- a/modules/demux/playlist/podcast.c
+++ b/modules/demux/playlist/podcast.c
@@ -189,28 +189,32 @@ static int Demux( demux_t *p_demux )
                         if( !strcmp( psz_name, "url" ) )
                         {
                             free( psz_item_mrl );
-                            psz_item_mrl = strdup( psz_value );
+                            psz_item_mrl = psz_value;
                         }
                         else if( !strcmp( psz_name, "length" ) )
                         {
                             free( psz_item_size );
-                            psz_item_size = strdup( psz_value );
+                            psz_item_size = psz_value;
                         }
                         else if( !strcmp( psz_name, "type" ) )
                         {
                             free( psz_item_type );
-                            psz_item_type = strdup( psz_value );
+                            psz_item_type = psz_value;
                         }
                         else
+                        {
                             msg_Dbg( p_demux,"unhandled attribure %s in element %s",
                                      psz_name, psz_elname );
+                            free( psz_value );
+                        }
                     }
                     else
+                    {
                         msg_Dbg( p_demux,"unhandled attribure %s in element %s",
                                   psz_name, psz_elname );
-
+                        free( psz_value );
+                    }
                     free( psz_name );
-                    free( psz_value );
                 }
                 break;
             }




More information about the vlc-devel mailing list