]> git.sesse.net Git - vlc/commitdiff
audioscrobbler: factorize test and fix potential memleak
authorRémi Duraffort <ivoire@videolan.org>
Mon, 2 Dec 2013 07:48:12 +0000 (08:48 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 2 Dec 2013 07:48:12 +0000 (08:48 +0100)
modules/misc/audioscrobbler.c

index 4799a9ef4993dbe2ab8350bbdf9d37437141336d..f6ff2d37b56ee62f9466137605c481084f7a2088 100644 (file)
@@ -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);