]> granicus.if.org Git - python/commitdiff
bpo-35451: Fix reference counting for sys.warnoptions and sys._xoptions. (GH-11063)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 10 Dec 2018 10:08:54 +0000 (12:08 +0200)
committerGitHub <noreply@github.com>
Mon, 10 Dec 2018 10:08:54 +0000 (12:08 +0200)
Python/sysmodule.c

index 49fa3842b583b8df434e3bee97954a8f835ca080..e6f1c4e8e9e0c0f41080fc3dc1d58ec63e60ae67 100644 (file)
@@ -1774,7 +1774,6 @@ get_warnoptions(void)
          * call optional for embedding applications, thus making this
          * reachable again.
          */
-        Py_XDECREF(warnoptions);
         warnoptions = PyList_New(0);
         if (warnoptions == NULL)
             return NULL;
@@ -1864,7 +1863,6 @@ get_xoptions(void)
          * call optional for embedding applications, thus making this
          * reachable again.
          */
-        Py_XDECREF(xoptions);
         xoptions = PyDict_New();
         if (xoptions == NULL)
             return NULL;