]> granicus.if.org Git - python/commitdiff
bpo-36447, bpo-36447: Fix refleak in _PySys_InitMain() (GH-12586)
authorPablo Galindo <Pablogsal@gmail.com>
Wed, 27 Mar 2019 12:43:47 +0000 (12:43 +0000)
committerVictor Stinner <vstinner@redhat.com>
Wed, 27 Mar 2019 12:43:47 +0000 (13:43 +0100)
Fix refleak in sysmodule.c when calling SET_SYS_FROM_STRING_BORROW.

Python/sysmodule.c

index 1af11c4ab97c623eb5ad025513a045003052f290..3de94e8468bee11173bed407033f12f4377f59d0 100644 (file)
@@ -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