From cd730ec08d8fc5afc557ae7f39c948998cd96bbb Mon Sep 17 00:00:00 2001 From: gikidy Date: Mon, 18 Jan 2010 07:20:22 +0000 Subject: Minor code enhancement. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9792 6f19259b-4bc3-4df7-8a09-765794883524 --- IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'IntelFrameworkModulePkg/Library') diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c index 7a9756e1f1..e6b2fe4d17 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -567,7 +567,9 @@ BdsExpandPartitionPartialDevicePathToFull ( TempNewDevicePath = CachedDevicePath; CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath); - FreePool(TempNewDevicePath); + if (TempNewDevicePath != NULL) { + FreePool(TempNewDevicePath); + } } else { TempNewDevicePath = CachedDevicePath; CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath); @@ -616,7 +618,9 @@ BdsExpandPartitionPartialDevicePathToFull ( } } - FreePool (CachedDevicePath); + if (CachedDevicePath != NULL) { + FreePool (CachedDevicePath); + } if (BlockIoBuffer != NULL) { FreePool (BlockIoBuffer); } -- cgit v1.2.3