+ //\r
+ // As the SmmInstallConfigurationTable() may be re-entered by FreePool() in\r
+ // its calling stack, updating System table to the new table pointer must\r
+ // be done before calling FreePool() to free the old table.\r
+ // It can make sure the gSmmCoreSmst.SmmConfigurationTable point to the new\r
+ // table and avoid the errors of use-after-free to the old table by the\r
+ // reenter of SmmInstallConfigurationTable() in FreePool()'s calling stack.\r
+ //\r
+ gSmmCoreSmst.SmmConfigurationTable = ConfigurationTable;\r
+\r
+ //\r
+ // Free the old table after updating System Table to the new table pointer.\r
+ //\r
+ FreePool (OldTable);\r
+ } else {\r
+ //\r
+ // Update System Table\r
+ //\r
+ gSmmCoreSmst.SmmConfigurationTable = ConfigurationTable;\r
+ }\r