[Python-checkins] gh-90716: Fix pylong_int_from_string() refleak (#99094)
vstinner
webhook-mailer at python.org
Fri Nov 4 09:24:16 EDT 2022
https://github.com/python/cpython/commit/387f72588d538bc56669f0f28cc41df854fc5b43
commit: 387f72588d538bc56669f0f28cc41df854fc5b43
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2022年11月04日T14:24:10+01:00
summary:
gh-90716: Fix pylong_int_from_string() refleak (#99094)
Fix validated by:
$ ./python -m test -R 3:3 test_int
Tests result: SUCCESS
files:
M Objects/longobject.c
diff --git a/Objects/longobject.c b/Objects/longobject.c
index a87293899001..652fdb7974b1 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -2376,6 +2376,7 @@ pylong_int_from_string(const char *start, const char *end, PyLongObject **res)
goto error;
}
if (!PyLong_Check(result)) {
+ Py_DECREF(result);
PyErr_SetString(PyExc_TypeError,
"_pylong.int_from_string did not return an int");
goto error;
More information about the Python-checkins
mailing list