[NTFS] Don't leak memory in case of failure while creating a directory
[reactos.git] / drivers / filesystems / ntfs / create.c
index b591b79..f37a951 100644 (file)
@@ -772,6 +772,7 @@ NtfsCreateDirectory(PDEVICE_EXTENSION DeviceExt,
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("ERROR: Failed to add index root to new file record!\n");
+        ExFreePoolWithTag(NewIndexRoot, TAG_NTFS);
         ExFreePoolWithTag(FileRecord, TAG_NTFS);
         return Status;
     }