From e53bf79de7429a7c49799d2d3a5571e1e77108d7 Mon Sep 17 00:00:00 2001 From: jcarsey Date: Mon, 4 Oct 2010 16:28:35 +0000 Subject: verify that a memory allocation was successful. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10907 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c index 64f504a258..c29e7e93fe 100644 --- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c +++ b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c @@ -1279,6 +1279,9 @@ ShellCommandConsistMappingGenMappingName ( NewSize = (Str.Len + 1) * sizeof (CHAR16); Str.Str = ReallocatePool (Str.Len, NewSize, Str.Str); + if (Str.Str == NULL) { + return (NULL); + } Str.Str[Str.Len] = CHAR_NULL; return Str.Str; } -- cgit v1.2.3