[MOUNTMGR] QueryPointsFromMemory(): Do not leak DeviceName.Buffer
authorSerge Gautherie <reactos-git_serge_171003@gautherie.fr>
Sat, 5 Oct 2019 23:01:31 +0000 (01:01 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 6 Oct 2019 08:52:05 +0000 (10:52 +0200)
Follow-up to 7601011f4ed578ae4a15a55298ebbe96fe3a1129.

drivers/filters/mountmgr/point.c

index 198e0a5..373ade7 100644 (file)
@@ -344,6 +344,11 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
     {
         Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS);
 
     {
         Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS);
 
+        if (SymbolicName)
+        {
+            FreePool(DeviceName.Buffer);
+        }
+
         return STATUS_BUFFER_OVERFLOW;
     }
 
         return STATUS_BUFFER_OVERFLOW;
     }
 
@@ -419,6 +424,11 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
         }
     }
 
         }
     }
 
+    if (SymbolicName)
+    {
+        FreePool(DeviceName.Buffer);
+    }
+
     return STATUS_SUCCESS;
 }
 
     return STATUS_SUCCESS;
 }