[vlc-devel] commit: rss: fix a memleak (double strdup) and add a missing const. ( Rémi Duraffort )

git version control git at videolan.org
Wed Jul 1 09:20:19 CEST 2009


vlc | branch: 1.0-bugfix | Rémi Duraffort <ivoire at videolan.org> | Wed Jul  1 09:07:19 2009 +0200| [05f10ae5e5685e713eb698cb0b2e8c96d3cad956] | committer: Rémi Duraffort 

rss: fix a memleak (double strdup) and add a missing const.
(cherry picked from commit f759a373ab6483c0d25d1bf84fd49151172c263a)

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

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

diff --git a/modules/video_filter/rss.c b/modules/video_filter/rss.c
index 10a8182..bb5a330 100644
--- a/modules/video_filter/rss.c
+++ b/modules/video_filter/rss.c
@@ -632,12 +632,12 @@ static picture_t *LoadImage( filter_t *p_filter, const char *psz_url )
  * remove all ' ' '\t' '\n' '\r' characters from the begining and end of the
  * string.
  ***************************************************************************/
-static char *removeWhiteChars( char *psz_src )
+static char *removeWhiteChars( const char *psz_src )
 {
-    char *psz_src2 = strdup( psz_src );
-    char *psz_clean = strdup( psz_src2 );
-    char *psz_clean2;
+    char *psz_src2,*psz_clean, *psz_clean2;
+    psz_src2 = psz_clean = strdup( psz_src );
     int i;
+
     while( ( *psz_clean == ' ' || *psz_clean == '\t'
            || *psz_clean == '\n' || *psz_clean == '\r' )
            && *psz_clean != '\0' )




More information about the vlc-devel mailing list