client/common/cmdline.c: remove redundant check
authorIlya Shipitsin <chipitsine@gmail.com>
Sat, 2 Feb 2019 05:22:19 +0000 (10:22 +0500)
committerIlya Shipitsin <chipitsine@gmail.com>
Sat, 2 Feb 2019 05:22:19 +0000 (10:22 +0500)
found by cppcheck

[client/common/cmdline.c:390] -> [client/common/cmdline.c:399]: (warning) Identical inner 'if' condition is always true.

client/common/cmdline.c

index a10947c..62031cb 100644 (file)
@@ -396,13 +396,10 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, int count,
 
                        printer->Type = RDPDR_DTYP_PRINT;
 
-                       if (count > 1)
+                       if (!(printer->Name = _strdup(params[1])))
                        {
-                               if (!(printer->Name = _strdup(params[1])))
-                               {
-                                       free(printer);
-                                       return FALSE;
-                               }
+                               free(printer);
+                               return FALSE;
                        }
 
                        if (count > 2)