Skip to content

Commit 387f725

Browse files
authored
gh-90716: Fix pylong_int_from_string() refleak (#99094)
Fix validated by: $ ./python -m test -R 3:3 test_int Tests result: SUCCESS
1 parent c0bf760 commit 387f725

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/longobject.c

+1
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,7 @@ pylong_int_from_string(const char *start, const char *end, PyLongObject **res)
23762376
goto error;
23772377
}
23782378
if (!PyLong_Check(result)) {
2379+
Py_DECREF(result);
23792380
PyErr_SetString(PyExc_TypeError,
23802381
"_pylong.int_from_string did not return an int");
23812382
goto error;

0 commit comments

Comments
 (0)