ShellPkg/ShellAddEnvVarToList: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Ruiyu Ni
2016-07-11 13:56:49 +08:00
parent 31e5b912b9
commit ffbc60a027
3 changed files with 43 additions and 33 deletions

View File

@ -240,11 +240,14 @@ ShellFindEnvVarInList (
@param Key The name of the environment variable.
@param Value The value of environment variable.
@param ValueSize The size in bytes of the environment variable
including the tailing CHAR_NELL
including the tailing CHAR_NULL
@param Atts The attributes of the variable.
@retval EFI_SUCCESS The environment variable was added to list successfully.
@retval others Some errors happened.
**/
VOID
EFI_STATUS
ShellAddEnvVarToList (
IN CONST CHAR16 *Key,
IN CONST CHAR16 *Value,