[LOGOFF]
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 31 Oct 2014 10:24:48 +0000 (10:24 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 31 Oct 2014 10:24:48 +0000 (10:24 +0000)
* LocalFree should only be executed if AllocAndLoadString() succeeds. Spotted by Thomas Faber.

svn path=/trunk/; revision=65137

reactos/base/applications/logoff/logoff.c

index 3d46314..ca57012 100644 (file)
@@ -89,9 +89,10 @@ BOOL ParseCommandLine(int argc, TCHAR *argv[])
                        }
                default:
                        //Invalid parameter detected
-                       if (AllocAndLoadString(&lpIllegalMsg, GetModuleHandle(NULL), IDS_ILLEGAL_PARAM))
-                       _putts(lpIllegalMsg);
-                       LocalFree(lpIllegalMsg);
+                       if (AllocAndLoadString(&lpIllegalMsg, GetModuleHandle(NULL), IDS_ILLEGAL_PARAM)) {
+                               _putts(lpIllegalMsg);
+                               LocalFree(lpIllegalMsg);
+                       }
                        return FALSE;
                }
        }