summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b390737)
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
- if (FileBuffer == NULL) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
-\r
if (InputLength == 0) {\r
if (InputLength == 0) {\r
+ if (FileBuffer != NULL) {\r
+ free (FileBuffer);\r
+ }\r
Error (NULL, 0, 2000, "Invalid parameter", "the size of input file %s can't be zero", InputFileName);\r
return EFI_NOT_FOUND;\r
}\r
\r
Error (NULL, 0, 2000, "Invalid parameter", "the size of input file %s can't be zero", InputFileName);\r
return EFI_NOT_FOUND;\r
}\r
\r
+ //\r
+ // InputLength != 0, but FileBuffer == NULL means out of resources.\r
+ //\r
+ if (FileBuffer == NULL) {\r
+ Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
//\r
// Now data is in FileBuffer + Offset\r
//\r
//\r
// Now data is in FileBuffer + Offset\r
//\r