[Python-checkins] bpo-36447, bpo-36447: Fix refleak in _PySys_InitMain() (GH-12586)

Victor Stinner webhook-mailer at python.org
Wed Mar 27 08:43:53 EDT 2019


https://github.com/python/cpython/commit/34ef64fe5947bd7e1b075c785fc1125c4e600cd4
commit: 34ef64fe5947bd7e1b075c785fc1125c4e600cd4
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: Victor Stinner <vstinner at redhat.com>
date: 2019-03-27T13:43:47+01:00
summary:

bpo-36447, bpo-36447: Fix refleak in _PySys_InitMain() (GH-12586)

Fix refleak in sysmodule.c when calling SET_SYS_FROM_STRING_BORROW.

files:
M Python/sysmodule.c

diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 1af11c4ab97c..3de94e8468be 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2635,6 +2635,7 @@ _PySys_InitMain(PyInterpreterState *interp)
         return -1;
     }
     SET_SYS_FROM_STRING_BORROW("_xoptions", xoptions);
+    Py_DECREF(xoptions);
 
 #undef COPY_LIST
 #undef SET_SYS_FROM_WSTR



More information about the Python-checkins mailing list