MdeModulePkg: Add ASSERT to make sure pointers are not NULL

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
Dandan Bi 2016-02-29 15:08:56 +08:00 committed by Feng Tian
parent 1b96026e14
commit d0d34cdf1d
1 changed files with 2 additions and 0 deletions

View File

@ -584,6 +584,7 @@ LibIsSupportedFileType (
}
TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType);
ASSERT(TmpStr != NULL);
LibToLowerString(TmpStr);
IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? FALSE : TRUE);
@ -1361,6 +1362,7 @@ ChooseFile (
gFileExplorerPrivate.ChooseHandler = ChooseHandler;
if (FileType != NULL) {
gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), FileType);
ASSERT(gFileExplorerPrivate.FileType != NULL);
LibToLowerString(gFileExplorerPrivate.FileType);
} else {
gFileExplorerPrivate.FileType = NULL;