diff --git a/InOsEmuPkg/EmuGopDxe/GopScreen.c b/InOsEmuPkg/EmuGopDxe/GopScreen.c index e7e58adf80..7f4333d169 100644 --- a/InOsEmuPkg/EmuGopDxe/GopScreen.c +++ b/InOsEmuPkg/EmuGopDxe/GopScreen.c @@ -372,7 +372,7 @@ EmuGopDestructor ( Status = EFI_SUCCESS; if (!Private->HardwareNeedsStarting) { - Status = Private->EmuIoThunk->Open (Private->EmuIoThunk); + Status = Private->EmuIoThunk->Close (Private->EmuIoThunk); Private->EmuGraphicsWindow = NULL; } diff --git a/InOsEmuPkg/Unix/Sec/BlockIo.c b/InOsEmuPkg/Unix/Sec/BlockIo.c index 64494fe83f..b764a63660 100644 --- a/InOsEmuPkg/Unix/Sec/BlockIo.c +++ b/InOsEmuPkg/Unix/Sec/BlockIo.c @@ -701,6 +701,7 @@ EmuBlockIoThunkClose ( free (Private->Filename); } free (This->Private); + This->Private = NULL; } return EFI_SUCCESS; diff --git a/InOsEmuPkg/Unix/Sec/PosixFileSystem.c b/InOsEmuPkg/Unix/Sec/PosixFileSystem.c index 720f10218a..723e7bee7b 100644 --- a/InOsEmuPkg/Unix/Sec/PosixFileSystem.c +++ b/InOsEmuPkg/Unix/Sec/PosixFileSystem.c @@ -1537,6 +1537,7 @@ PosixFileSystmeThunkClose ( free (Private->VolumeLabel); } free (This->Private); + This->Private = NULL; } return EFI_SUCCESS;