Hello, please don't leak memory.
Cheers.

Spotted by Thomas

svn path=/trunk/; revision=64625
This commit is contained in:
Pierre Schweitzer 2014-10-08 20:02:09 +00:00
parent 60d23c0d1d
commit 55fe55e6c5

View file

@ -285,18 +285,21 @@ NtfsMakeRootFCB(PNTFS_VCB Vcb)
if (!NT_SUCCESS(ReadFileRecord(Vcb, NTFS_FILE_ROOT, MftRecord))) if (!NT_SUCCESS(ReadFileRecord(Vcb, NTFS_FILE_ROOT, MftRecord)))
{ {
ExFreePoolWithTag(MftRecord, TAG_NTFS);
return NULL; return NULL;
} }
FileName = GetFileNameFromRecord(MftRecord); FileName = GetFileNameFromRecord(MftRecord);
if (!FileName) if (!FileName)
{ {
ExFreePoolWithTag(MftRecord, TAG_NTFS);
return NULL; return NULL;
} }
Fcb = NtfsCreateFCB(L"\\", Vcb); Fcb = NtfsCreateFCB(L"\\", Vcb);
if (!Fcb) if (!Fcb)
{ {
ExFreePoolWithTag(MftRecord, TAG_NTFS);
return NULL; return NULL;
} }
@ -315,6 +318,8 @@ NtfsMakeRootFCB(PNTFS_VCB Vcb)
NtfsAddFCBToTable(Vcb, Fcb); NtfsAddFCBToTable(Vcb, Fcb);
NtfsGrabFCB(Vcb, Fcb); NtfsGrabFCB(Vcb, Fcb);
ExFreePoolWithTag(MftRecord, TAG_NTFS);
return Fcb; return Fcb;
} }