diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-04 13:24:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 13:24:10 (GMT) |
commit | 387f72588d538bc56669f0f28cc41df854fc5b43 (patch) | |
tree | c24a2f3fddfc51d43c399d29b46f0895d0523d2b | |
parent | c0bf7607a1c215cd92f2976c9e915b913fc149d1 (diff) | |
download | cpython-387f72588d538bc56669f0f28cc41df854fc5b43.zip cpython-387f72588d538bc56669f0f28cc41df854fc5b43.tar.gz cpython-387f72588d538bc56669f0f28cc41df854fc5b43.tar.bz2 |
gh-90716: Fix pylong_int_from_string() refleak (#99094)
Fix validated by:
$ ./python -m test -R 3:3 test_int
Tests result: SUCCESS
-rw-r--r-- | Objects/longobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index a872938..652fdb7 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; |