[MUP]
authorPierre Schweitzer <pierre@reactos.org>
Fri, 4 Sep 2015 13:58:44 +0000 (13:58 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Fri, 4 Sep 2015 13:58:44 +0000 (13:58 +0000)
Fix uninitialized address freeing in case of error in MupGetProviderInformation(), InitializeProvider()
CID 1322227
CID 1322240

svn path=/trunk/; revision=68990

reactos/drivers/filesystems/mup/mup.c

index 674a25d..c1535a3 100644 (file)
@@ -950,6 +950,10 @@ InitializeProvider(PCWSTR ProviderName,
 
         Status = ZwQueryValueKey(KeyHandle, &Value, KeyValueFullInformation, Info, ResultLength, &ResultLength);
     }
+    else
+    {
+        Info = NULL;
+    }
 
     ZwClose(KeyHandle);
 
@@ -959,6 +963,7 @@ InitializeProvider(PCWSTR ProviderName,
      */
     if (NT_SUCCESS(Status))
     {
+        ASSERT(Info != NULL);
         AddUnregisteredProvider((PWSTR)((ULONG_PTR)Info + Info->DataOffset), ProviderOrder);
     }
 
@@ -1006,11 +1011,17 @@ MupGetProviderInformation(VOID)
 
         Status = ZwQueryValueKey(KeyHandle, &ProviderOrder, KeyValueFullInformation, Info, ResultLength, &ResultLength);
     }
+    else
+    {
+        Info = NULL;
+    }
 
     ZwClose(KeyHandle);
 
     if (NT_SUCCESS(Status))
     {
+        ASSERT(Info != NULL);
+
         Providers = (PWSTR)((ULONG_PTR)Info + Info->DataOffset);
         End = FALSE;
         ProviderCount = 0;