mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
tst: passthrough: fix missed FspFileSystemReleaseDirectoryBuffer in case of error
This commit is contained in:
parent
9ecfc64178
commit
ede72e4c5f
@ -622,9 +622,14 @@ static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
|
|
||||||
Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0);
|
Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0);
|
||||||
if (0 == Length)
|
if (0 == Length)
|
||||||
return FspNtStatusFromWin32(GetLastError());
|
DirBufferResult = FspNtStatusFromWin32(GetLastError());
|
||||||
if (Length + 1 + PatternLength >= FULLPATH_SIZE)
|
else if (Length + 1 + PatternLength >= FULLPATH_SIZE)
|
||||||
return STATUS_OBJECT_NAME_INVALID;
|
DirBufferResult = STATUS_OBJECT_NAME_INVALID;
|
||||||
|
if (!NT_SUCCESS(DirBufferResult))
|
||||||
|
{
|
||||||
|
FspFileSystemReleaseDirectoryBuffer(&FileContext->DirBuffer);
|
||||||
|
return DirBufferResult;
|
||||||
|
}
|
||||||
|
|
||||||
if (L'\\' != FullPath[Length - 1])
|
if (L'\\' != FullPath[Length - 1])
|
||||||
FullPath[Length++] = L'\\';
|
FullPath[Length++] = L'\\';
|
||||||
|
@ -538,9 +538,14 @@ static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
|
|
||||||
Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0);
|
Length = GetFinalPathNameByHandleW(Handle, FullPath, FULLPATH_SIZE - 1, 0);
|
||||||
if (0 == Length)
|
if (0 == Length)
|
||||||
return FspNtStatusFromWin32(GetLastError());
|
DirBufferResult = FspNtStatusFromWin32(GetLastError());
|
||||||
if (Length + 1 + PatternLength >= FULLPATH_SIZE)
|
else if (Length + 1 + PatternLength >= FULLPATH_SIZE)
|
||||||
return STATUS_OBJECT_NAME_INVALID;
|
DirBufferResult = STATUS_OBJECT_NAME_INVALID;
|
||||||
|
if (!NT_SUCCESS(DirBufferResult))
|
||||||
|
{
|
||||||
|
FspFileSystemReleaseDirectoryBuffer(&FileContext->DirBuffer);
|
||||||
|
return DirBufferResult;
|
||||||
|
}
|
||||||
|
|
||||||
if (L'\\' != FullPath[Length - 1])
|
if (L'\\' != FullPath[Length - 1])
|
||||||
FullPath[Length++] = L'\\';
|
FullPath[Length++] = L'\\';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user