[Python-checkins] bpo-46407: Fix long_mod refleak (GH-31025)

ambv webhook-mailer at python.org
Mon Jan 31 05:41:51 EST 2022


https://github.com/python/cpython/commit/768569325abc0a9cd5aae65c531889ec390847aa
commit: 768569325abc0a9cd5aae65c531889ec390847aa
branch: main
author: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2022-01-31T11:41:14+01:00
summary:

bpo-46407: Fix long_mod refleak (GH-31025)

files:
M Objects/longobject.c

diff --git a/Objects/longobject.c b/Objects/longobject.c
index cc4ceec21aaca..e1f6a6402841b 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -2744,7 +2744,7 @@ long_rem(PyLongObject *a, PyLongObject *b, PyLongObject **prem)
     }
     else {
         /* Slow path using divrem. */
-        x_divrem(a, b, prem);
+        Py_XDECREF(x_divrem(a, b, prem));
         if (*prem == NULL)
             return -1;
     }



More information about the Python-checkins mailing list