[ros-dev] [ros-diffs] [pschweitzer] 64617: [NTFS] - Add a directory entry into FCB which will be a copy of the $FILE_NAME attribute of the FILE record. Though, it won't contain the name itself (in the FCB instead), so k...

Pierre Schweitzer pierre at reactos.org
Wed Oct 8 20:01:03 UTC 2014


Ah yes! Oopsie :-$

Let's not add more leaks into it!

On 08/10/2014 21:54, Thomas Faber wrote:
> On 2014-10-08 21:32, pschweitzer at svn.reactos.org wrote:
>> +    MftRecord = ExAllocatePoolWithTag(NonPagedPool,
>> +                                      Vcb->NtfsInfo.BytesPerFileRecord,
>> +                                      TAG_NTFS);
>> +    if (MftRecord == NULL)
>> +    {
>> +        return NULL;
>> +    }
>> +
>> +    if (!NT_SUCCESS(ReadFileRecord(Vcb, NTFS_FILE_ROOT, MftRecord)))
>> +    {
>> +        return NULL;
>> +    }
>> +
>> +    FileName = GetFileNameFromRecord(MftRecord);
>> +    if (!FileName)
>> +    {
>> +        return NULL;
>> +    }
>>  
>>      Fcb = NtfsCreateFCB(L"\\", Vcb);
>> -
>> -//    memset(Fcb->entry.Filename, ' ', 11);
>> -
>> -//    Fcb->Entry.DataLengthL = Vcb->CdInfo.RootSize;
>> -//    Fcb->Entry.ExtentLocationL = Vcb->CdInfo.RootStart;
>> -//    Fcb->Entry.FileFlags = 0x02; // FILE_ATTRIBUTE_DIRECTORY;
>> +    if (!Fcb)
>> +    {
>> +        return NULL;
>> +    }
> 
> 
> These failure cases look like they're all at least leaking MftRecord :p
> 
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev
> 


-- 
Pierre Schweitzer <pierre at reactos.org>
System & Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3968 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20141008/74ed37fd/attachment.bin>


More information about the Ros-dev mailing list