Author: hbelusca
Date: Wed Jul 13 16:33:37 2016
New Revision: 71927

URL: http://svn.reactos.org/svn/reactos?rev=71927&view=rev
Log:
[SETUP]
- Fix leaking 'pSetupData' in case of failure. CID 1363604
- Since we know that in the remaining of the code, 'pSetupData' is a valid 
pointer, we can free it at the very end without rechecking whether it was NULL 
or not.
CORE-11591 #resolve

Modified:
    trunk/reactos/base/setup/reactos/reactos.c

Modified: trunk/reactos/base/setup/reactos/reactos.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/reactos.c?rev=71927&r1=71926&r2=71927&view=diff
==============================================================================
--- trunk/reactos/base/setup/reactos/reactos.c  [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/reactos.c  [iso-8859-1] Wed Jul 13 
16:33:37 2016
@@ -788,7 +788,10 @@
     if (!pSetupData->bUnattend)
     {
         if (!LoadSetupData(pSetupData))
+        {
+            HeapFree(GetProcessHeap(), 0, pSetupData);
             return 0;
+        }
 
         /* Create the Start page, until setup is working */
         psp.dwSize = sizeof(PROPSHEETPAGE);
@@ -881,8 +884,7 @@
     if (pSetupData->hTitleFont)
         DeleteObject(pSetupData->hTitleFont);
 
-    if (pSetupData != NULL)
-        HeapFree(GetProcessHeap(), 0, pSetupData);
+    HeapFree(GetProcessHeap(), 0, pSetupData);
 
 #if 0
     EnableShutdownPrivilege();


Reply via email to