https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f8e5d1ce002ee00a185d…
commit 9f8e5d1ce002ee00a185d535c1bf745b782adf1d
Author:     Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Sun Oct 6 01:01:31 2019 +0200
Commit:     Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sun Oct 6 10:52:05 2019 +0200
    [MOUNTMGR] QueryPointsFromMemory(): Do not leak DeviceName.Buffer
    Follow-up to 7601011f4ed578ae4a15a55298ebbe96fe3a1129.
---
 drivers/filters/mountmgr/point.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/drivers/filters/mountmgr/point.c b/drivers/filters/mountmgr/point.c
index 198e0a5324c..373ade76aa9 100644
--- a/drivers/filters/mountmgr/point.c
+++ b/drivers/filters/mountmgr/point.c
@@ -344,6 +344,11 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
     {
         Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS);
+        if (SymbolicName)
+        {
+            FreePool(DeviceName.Buffer);
+        }
+
         return STATUS_BUFFER_OVERFLOW;
     }
@@ -419,6 +424,11 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
         }
     }
+    if (SymbolicName)
+    {
+        FreePool(DeviceName.Buffer);
+    }
+
     return STATUS_SUCCESS;
 }