]> granicus.if.org Git - python/commitdiff
bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)
authorbtharper <btharper1221@gmail.com>
Tue, 19 Mar 2019 10:50:25 +0000 (06:50 -0400)
committerVictor Stinner <vstinner@redhat.com>
Tue, 19 Mar 2019 10:50:25 +0000 (11:50 +0100)
_PyPreConfig_Read() now free 'old_old' at exit.

Misc/NEWS.d/next/Build/2019-03-18-23-49-15.bpo-36356.WNrwYI.rst [new file with mode: 0644]
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 (file)
index 0000000..d30f5d5
--- /dev/null
@@ -0,0 +1 @@
+Fix leaks that led to build failure when configured with address sanitizer.
index 1efc7ee5c56ed1ad7f0b8d78e27531d8c761cd1d..b03436181c860bdbc3341f2a347dd483c818ed6c 100644 (file)
@@ -514,6 +514,7 @@ _PyPreConfig_Read(_PyPreConfig *config)
     err = preconfig_read(config, NULL);
 
     setlocale(LC_CTYPE, old_loc);
+    PyMem_RawFree(old_loc);
 
     return err;
 }