Mercurial > cpython-lru_cache-weakref
diff Modules/_io/bytesio.c @ 78876:df663603e67a 3.2
Issue #15868: Fix refleak in bytesio.c (Coverity #715365).
| author | Stefan Krah <skrah@bytereef.org> |
|---|---|
| date | Sat, 08 Sep 2012 11:12:33 +0200 |
| parents | 524931e5aebf |
| children | 90c8fa612e5b |
line wrap: on
line diff
--- a/Modules/_io/bytesio.c Fri Sep 07 23:49:07 2012 +0200 +++ b/Modules/_io/bytesio.c Sat Sep 08 11:12:33 2012 +0200 @@ -692,8 +692,10 @@ } else { dict = PyDict_Copy(self->dict); - if (dict == NULL) + if (dict == NULL) { + Py_DECREF(initvalue); return NULL; + } } state = Py_BuildValue("(OnN)", initvalue, self->pos, dict);
