Skip to content

Commit b88b3a6

Browse files
committed
Fix memory leak in FatIFileAccess error handling
A memory leak was discovered during fuzz testing: - The async task object (Task) created in FatIFileAccess was not being freed when FatGrowEof() returned an error Changes: - Moved the "Done" label to precede the "Task" check in if-then branch Signed-off-by: Pavel Naberezhnev <[email protected]>
1 parent c8ae30a commit b88b3a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

FatPkg/EnhancedFatDxe/ReadWrite.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ FatIFileAccess (
318318
}
319319
}
320320

321+
Done:
322+
321323
if (Token != NULL) {
322324
if (!EFI_ERROR (Status)) {
323325
Status = FatQueueTask (IFile, Task);
@@ -326,7 +328,6 @@ FatIFileAccess (
326328
}
327329
}
328330

329-
Done:
330331
//
331332
// On EFI_SUCCESS case, not calling FatCleanupVolume():
332333
// 1) The Cache flush operation is avoided to enhance

0 commit comments

Comments
 (0)