Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 29641:4909aa64405f legacy-trunk
SF patch 703666: Several objects don't decref tmp on failure in subtype_new
Submitted By: Christopher A. Craig
Fillin some missing decrefs.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Sat, 28 Jun 2003 20:04:25 +0000 |
| parents | 0b76679bf3f9 |
| children | 86fdf8fe7f17 |
line wrap: on
line diff
--- a/Objects/floatobject.c Sat Jun 28 15:22:16 2003 +0000 +++ b/Objects/floatobject.c Sat Jun 28 20:04:25 2003 +0000 @@ -751,8 +751,10 @@ return NULL; assert(PyFloat_CheckExact(tmp)); new = type->tp_alloc(type, 0); - if (new == NULL) + if (new == NULL) { + Py_DECREF(tmp); return NULL; + } ((PyFloatObject *)new)->ob_fval = ((PyFloatObject *)tmp)->ob_fval; Py_DECREF(tmp); return new;
