From 7de7c827beed217773f9792ab4e37c55dab59202 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 31 Oct 2014 10:24:48 +0000 Subject: [PATCH] [LOGOFF] * LocalFree should only be executed if AllocAndLoadString() succeeds. Spotted by Thomas Faber. svn path=/trunk/; revision=65137 --- reactos/base/applications/logoff/logoff.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/base/applications/logoff/logoff.c b/reactos/base/applications/logoff/logoff.c index 3d46314546d..ca570123e66 100644 --- a/reactos/base/applications/logoff/logoff.c +++ b/reactos/base/applications/logoff/logoff.c @@ -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; } }