diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsConsole.c b/MdeModulePkg/Library/GenericBdsLib/BdsConsole.c index 999de49ba3..af3572ff7d 100644 --- a/MdeModulePkg/Library/GenericBdsLib/BdsConsole.c +++ b/MdeModulePkg/Library/GenericBdsLib/BdsConsole.c @@ -166,7 +166,7 @@ BdsLibUpdateConsoleVariable ( if (VarConsole != NULL) { FreePool(VarConsole); } - if (NewDevicePath) { + if (NewDevicePath != NULL) { FreePool(NewDevicePath); } }