]> git.sesse.net Git - vlc/commitdiff
audioscrobbler: fix memleak.
authorRémi Duraffort <ivoire@videolan.org>
Sun, 3 May 2009 08:34:19 +0000 (10:34 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Sun, 3 May 2009 08:34:19 +0000 (10:34 +0200)
modules/misc/audioscrobbler.c

index a7b74ad77b330c358e5b5560f02193e623344ee8..7dd9401500717dbcdd4f6b5ae039bfcd22c7157a 100644 (file)
@@ -792,16 +792,21 @@ static int Handshake( intf_thread_t *p_this )
     psz_scrobbler_url = strdup( "post.audioscrobbler.com" );
 #endif
     if( !psz_scrobbler_url )
+    {
+        free( psz_username );
         return VLC_ENOMEM;
+    }
 
     if( !asprintf( &psz_handshake_url,
     "http://%s/?hs=true&p=1.2&c=%s&v=%s&u=%s&t=%s&a=%s", psz_scrobbler_url,
         CLIENT_NAME, CLIENT_VERSION, psz_username, psz_timestamp,
         p_sys->psz_auth_token ) )
     {
+        free( psz_scrobbler_url );
         free( psz_username );
         return VLC_ENOMEM;
     }
+    free( psz_scrobbler_url );
     free( psz_username );
 
     /* send the http handshake request */