summaryrefslogtreecommitdiff
path: root/simplejson
diff options
context:
space:
mode:
Diffstat (limited to 'simplejson')
-rw-r--r--simplejson/_speedups.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
index ec054c7..43c589b 100644
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -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);
}
}