From: Pablo Galindo Date: Wed, 27 Mar 2019 12:43:47 +0000 (+0000) Subject: bpo-36447, bpo-36447: Fix refleak in _PySys_InitMain() (GH-12586) X-Git-Tag: v3.8.0a4~321 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34ef64fe5947bd7e1b075c785fc1125c4e600cd4;p=python bpo-36447, bpo-36447: Fix refleak in _PySys_InitMain() (GH-12586) Fix refleak in sysmodule.c when calling SET_SYS_FROM_STRING_BORROW. --- diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 1af11c4ab9..3de94e8468 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