[NTOSKRNL]
authorCameron Gutman <aicommander@gmail.com>
Wed, 9 Jun 2010 21:53:42 +0000 (21:53 +0000)
committerCameron Gutman <aicommander@gmail.com>
Wed, 9 Jun 2010 21:53:42 +0000 (21:53 +0000)
- Set the resource list pointer to NULL after we free it
- Fixes a double-free issue in the resource conflict resolution code

svn path=/trunk/; revision=47725

reactos/ntoskrnl/io/pnpmgr/pnpres.c

index 699e797..2e93929 100644 (file)
@@ -243,6 +243,7 @@ IopCreateResourceListFromRequirements(
                   if (ReqDesc->Option == 0)
                   {
                       ExFreePool(*ResourceList);
+                      *ResourceList = NULL;
                       return STATUS_CONFLICTING_ADDRESSES;
                   }
               }
@@ -258,6 +259,7 @@ IopCreateResourceListFromRequirements(
                   if (ReqDesc->Option == 0)
                   {
                       ExFreePool(*ResourceList);
+                      *ResourceList = NULL;
                       return STATUS_CONFLICTING_ADDRESSES;
                   }
               }
@@ -273,6 +275,7 @@ IopCreateResourceListFromRequirements(
                   if (ReqDesc->Option == 0)
                   {
                       ExFreePool(*ResourceList);
+                      *ResourceList = NULL;
                       return STATUS_CONFLICTING_ADDRESSES;
                   }
               }
@@ -288,6 +291,7 @@ IopCreateResourceListFromRequirements(
                   if (ReqDesc->Option == 0)
                   {
                       ExFreePool(*ResourceList);
+                      *ResourceList = NULL;
                       return STATUS_CONFLICTING_ADDRESSES;
                   }
               }
@@ -302,6 +306,7 @@ IopCreateResourceListFromRequirements(
                   if (ReqDesc->Option == 0)
                   {
                       ExFreePool(*ResourceList);
+                      *ResourceList = NULL;
                       return STATUS_CONFLICTING_ADDRESSES;
                   }
               }
@@ -852,6 +857,7 @@ IopAssignDeviceResources(
       {
           DPRINT1("Boot resources for %wZ cause a resource conflict!\n", &DeviceNode->InstancePath);
           ExFreePool(DeviceNode->ResourceList);
+          DeviceNode->ResourceList = NULL;
       }
    }