mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 21:54:27 +02:00
MdeModulePkg: Fix memory leak issues
Fix memory leak issues Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18722 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e7e346962b
commit
fad21b7c57
@ -2,6 +2,7 @@
|
|||||||
Library functions which contain all the code to connect console device.
|
Library functions which contain all the code to connect console device.
|
||||||
|
|
||||||
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
|
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -301,6 +302,7 @@ BmUpdateSystemTableConsole (
|
|||||||
EFI_DEVICE_PATH_PROTOCOL *FullDevicePath;
|
EFI_DEVICE_PATH_PROTOCOL *FullDevicePath;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *VarConsole;
|
EFI_DEVICE_PATH_PROTOCOL *VarConsole;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *Instance;
|
EFI_DEVICE_PATH_PROTOCOL *Instance;
|
||||||
|
EFI_DEVICE_PATH_PROTOCOL *FullInstance;
|
||||||
VOID *Interface;
|
VOID *Interface;
|
||||||
EFI_HANDLE NewHandle;
|
EFI_HANDLE NewHandle;
|
||||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
|
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
|
||||||
@ -354,11 +356,13 @@ BmUpdateSystemTableConsole (
|
|||||||
//
|
//
|
||||||
// Find console device handle by device path instance
|
// Find console device handle by device path instance
|
||||||
//
|
//
|
||||||
|
FullInstance = Instance;
|
||||||
Status = gBS->LocateDevicePath (
|
Status = gBS->LocateDevicePath (
|
||||||
ConsoleGuid,
|
ConsoleGuid,
|
||||||
&Instance,
|
&Instance,
|
||||||
&NewHandle
|
&NewHandle
|
||||||
);
|
);
|
||||||
|
FreePool (FullInstance);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
//
|
//
|
||||||
// Get the console protocol on this console device handle
|
// Get the console protocol on this console device handle
|
||||||
@ -383,6 +387,7 @@ BmUpdateSystemTableConsole (
|
|||||||
TextOut->SetMode (TextOut, 0);
|
TextOut->SetMode (TextOut, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FreePool (FullDevicePath);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,6 +397,7 @@ BmUpdateSystemTableConsole (
|
|||||||
//
|
//
|
||||||
// No any available console devcie found.
|
// No any available console devcie found.
|
||||||
//
|
//
|
||||||
|
FreePool (FullDevicePath);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user