summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/pathconfig.c5
-rw-r--r--Python/preconfig.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/Python/pathconfig.c b/Python/pathconfig.c
index fb2d19e..0ee87c4 100644
--- a/Python/pathconfig.c
+++ b/Python/pathconfig.c
@@ -149,7 +149,12 @@ done:
void
_PyPathConfig_ClearGlobal(void)
{
+ PyMemAllocatorEx old_alloc;
+ _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
+
_PyPathConfig_Clear(&_Py_path_config);
+
+ PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
}
diff --git a/Python/preconfig.c b/Python/preconfig.c
index a86ece5..1efc7ee 100644
--- a/Python/preconfig.c
+++ b/Python/preconfig.c
@@ -758,6 +758,7 @@ _PyPreConfig_ReadFromArgv(_PyPreConfig *config, const _PyArgv *args)
done:
if (init_ctype_locale != NULL) {
setlocale(LC_CTYPE, init_ctype_locale);
+ PyMem_RawFree(init_ctype_locale);
}
_PyPreConfig_Clear(&save_config);
Py_UTF8Mode = init_utf8_mode ;