[vlc-commits] audioscrobbler: factorize test and fix potential memleak

Rémi Duraffort git at videolan.org
Mon Dec 2 08:53:13 CET 2013


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Dec  2 08:48:12 2013 +0100| [891aed990b75398af07ef6b56689b5f4ea0f2cc5] | committer: Rémi Duraffort

audioscrobbler: factorize test and fix potential memleak

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

 modules/misc/audioscrobbler.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 4799a9e..f6ff2d3 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -493,18 +493,10 @@ static int Handshake(intf_thread_t *p_this)
     intf_sys_t          *p_sys                  = p_this->p_sys;
 
     psz_username = var_InheritString(p_this, "lastfm-username");
-    if (!psz_username)
-        return VLC_ENOMEM;
-
     psz_password = var_InheritString(p_this, "lastfm-password");
-    if (!psz_password)
-    {
-        free(psz_username);
-        return VLC_ENOMEM;
-    }
 
     /* username or password have not been setup */
-    if (!*psz_username || !*psz_password)
+    if (EMPTY_STR(psz_username) || EMPTY_STR(psz_password))
     {
         free(psz_username);
         free(psz_password);



More information about the vlc-commits mailing list