mirror of https://github.com/acidanthera/audk.git
ShellPkg: Fix Shell ASSERT when read 'TAB' key fail from 'ConIn'.
Free 'FoundFileList' when read 'TAB' key fail to avoid memory leak and ASSERT. Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
parent
53c1329529
commit
9c17810a36
|
@ -572,8 +572,7 @@ FileInterfaceStdInRead(
|
|||
TabLinePos = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FoundFileList->Link);
|
||||
InTabScrolling = TRUE;
|
||||
} else {
|
||||
FreePool(FoundFileList);
|
||||
FoundFileList = NULL;
|
||||
ShellInfoObject.NewEfiShellProtocol->FreeFileList (&FoundFileList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -856,6 +855,9 @@ FileInterfaceStdInRead(
|
|||
// if this was used it should be deallocated by now...
|
||||
// prevent memory leaks...
|
||||
//
|
||||
if (FoundFileList != NULL) {
|
||||
ShellInfoObject.NewEfiShellProtocol->FreeFileList (&FoundFileList);
|
||||
}
|
||||
ASSERT(FoundFileList == NULL);
|
||||
|
||||
return Status;
|
||||
|
|
Loading…
Reference in New Issue