From 768569325abc0a9cd5aae65c531889ec390847aa Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Mon, 31 Jan 2022 18:41:14 +0800 Subject: [PATCH] bpo-46407: Fix long_mod refleak (GH-31025) --- Objects/longobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/longobject.c b/Objects/longobject.c index cc4ceec21aa..e1f6a640284 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; }