[vlc-devel] commit: Audio Scrobbler: Fix some tiny memleaks. ( Rémi Duraffort )

git version control git at videolan.org
Sun Aug 3 20:06:24 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Aug  3 20:06:06 2008 +0200| [191f9ff5cc794f8df402ac77c88b49888d3d573b] | committer: Rémi Duraffort 

Audio Scrobbler: Fix some tiny memleaks.

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

 modules/misc/audioscrobbler.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 8bde95e..e735308 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -950,7 +950,6 @@ static int ReadMetaData( intf_thread_t *p_this )
             free( psz_meta ); \
             return VLC_ENOMEM; \
         } \
-        free( psz_meta ); \
     }
 
     vlc_mutex_lock( &p_sys->lock );
@@ -966,6 +965,7 @@ static int ReadMetaData( intf_thread_t *p_this )
         free( psz_meta );
         return VLC_EGENERIC;
     }
+    free( psz_meta );
 
     ALLOC_ITEM_META( p_sys->p_current_song.psz_t, Title )
     else
@@ -977,6 +977,7 @@ static int ReadMetaData( intf_thread_t *p_this )
         free( psz_meta );
         return VLC_EGENERIC;
     }
+    free( psz_meta );
 
     /* Now we have read the mandatory meta data, so we can submit that info */
     p_sys->b_submit = true;
@@ -984,16 +985,19 @@ static int ReadMetaData( intf_thread_t *p_this )
     ALLOC_ITEM_META( p_sys->p_current_song.psz_b, Album )
     else
         p_sys->p_current_song.psz_b = calloc( 1, 1 );
+    free( psz_meta );
 
     ALLOC_ITEM_META( p_sys->p_current_song.psz_m, TrackID )
     else
         p_sys->p_current_song.psz_m = calloc( 1, 1 );
+    free( psz_meta );
 
     p_sys->p_current_song.i_l = input_item_GetDuration( p_item ) / 1000000;
 
     ALLOC_ITEM_META( p_sys->p_current_song.psz_n, TrackNum )
     else
         p_sys->p_current_song.psz_n = calloc( 1, 1 );
+    free( psz_meta );
 #undef ALLOC_ITEM_META
 
     msg_Dbg( p_this, "Meta data registered" );




More information about the vlc-devel mailing list