Skip to content

Commit

Permalink
SJ-PT-23-02: Fix missing reference count decrease
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Apr 4, 2023
1 parent 7c2ccb7 commit 1e495c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Version 3.19.0 released 2023-04-XX

* Fix invalid handling of unicode escape sequences in the pure Python
implementation of the decoder (SJ-PT-23-01)
* Fix missing reference count decrease if PyOS_string_to_double raises
an exception in Python 2.x; was probably unreachable (SJ-PT-23-02)

Version 3.18.4 released 2023-03-14

Expand Down
4 changes: 3 additions & 1 deletion simplejson/_speedups.c
Original file line number Diff line number Diff line change
Expand Up @@ -1949,8 +1949,10 @@ _match_number_str(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssiz
/* rval = PyFloat_FromDouble(PyOS_ascii_atof(PyString_AS_STRING(numstr))); */
double d = PyOS_string_to_double(PyString_AS_STRING(numstr),
NULL, NULL);
if (d == -1.0 && PyErr_Occurred())
if (d == -1.0 && PyErr_Occurred()) {
Py_DECREF(numstr);
return NULL;
}
rval = PyFloat_FromDouble(d);
}
}
Expand Down

0 comments on commit 1e495c1

Please sign in to comment.