X86PagingStructuresPAE: clear fVirtualPageDirs in constructor

... not just the first element. Fixes a crash in X86VMTranslationMapPAE
destructor when running out of memory when initializing the map.
This commit is contained in:
Ingo Weinhold
2013-09-18 00:42:44 +02:00
parent 34d0d4d85e
commit 93495b0354
@@ -21,7 +21,7 @@
X86PagingStructuresPAE::X86PagingStructuresPAE() X86PagingStructuresPAE::X86PagingStructuresPAE()
{ {
fVirtualPageDirs[0] = NULL; memset(fVirtualPageDirs, 0, sizeof(fVirtualPageDirs));
} }
@@ -29,6 +29,7 @@ X86PagingStructuresPAE::~X86PagingStructuresPAE()
{ {
// free the user page dirs // free the user page dirs
free(fVirtualPageDirs[0]); free(fVirtualPageDirs[0]);
// There's one contiguous allocation for 0 and 1.
// free the PDPT page // free the PDPT page
X86PagingMethodPAE::Method()->Free32BitPage(fPageDirPointerTable, X86PagingMethodPAE::Method()->Free32BitPage(fPageDirPointerTable,