[Python-checkins] bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)

Victor Stinner webhook-mailer at python.org
Tue Mar 19 06:50:30 EDT 2019


https://github.com/python/cpython/commit/e130a07eb20c4b655d182d5d10d778c7584efe55
commit: e130a07eb20c4b655d182d5d10d778c7584efe55
branch: master
author: btharper <btharper1221 at gmail.com>
committer: Victor Stinner <vstinner at redhat.com>
date: 2019-03-19T11:50:25+01:00
summary:

bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)

_PyPreConfig_Read() now free 'old_old' at exit.

files:
A Misc/NEWS.d/next/Build/2019-03-18-23-49-15.bpo-36356.WNrwYI.rst
M Python/preconfig.c

diff --git a/Misc/NEWS.d/next/Build/2019-03-18-23-49-15.bpo-36356.WNrwYI.rst b/Misc/NEWS.d/next/Build/2019-03-18-23-49-15.bpo-36356.WNrwYI.rst
new file mode 100644
index 000000000000..d30f5d586b7c
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2019-03-18-23-49-15.bpo-36356.WNrwYI.rst
@@ -0,0 +1 @@
+Fix leaks that led to build failure when configured with address sanitizer.
diff --git a/Python/preconfig.c b/Python/preconfig.c
index 1efc7ee5c56e..b03436181c86 100644
--- a/Python/preconfig.c
+++ b/Python/preconfig.c
@@ -514,6 +514,7 @@ _PyPreConfig_Read(_PyPreConfig *config)
     err = preconfig_read(config, NULL);
 
     setlocale(LC_CTYPE, old_loc);
+    PyMem_RawFree(old_loc);
 
     return err;
 }



More information about the Python-checkins mailing list