修复内存泄露

This commit is contained in:
duzhuolin
2023-08-01 10:37:03 +08:00
parent d65e08d529
commit ba1430fdc2

View File

@ -1387,6 +1387,8 @@ static void RestorePkgValuesByPkgState(PLpgSQL_package* targetPkg, PackageRuntim
if (fromVar->tableOfIndex != NULL) {
MemoryContext temp = MemoryContextSwitchTo(targetVar->pkg->pkg_cxt);
hash_destroy(targetVar->tableOfIndex);
targetVar->tableOfIndex = NULL;
targetVar->tableOfIndex = copyTableOfIndex(fromVar->tableOfIndex);
MemoryContextSwitchTo(temp);
} else if (fromVar->isnull) {