commit | 96efdd422cef75f70770107847b1a97e7e524e4c | [log] [tgz] |
---|---|---|
author | Stefan Krah <skrah@bytereef.org> | Sat Sep 08 11:12:33 2012 +0200 |
committer | Stefan Krah <skrah@bytereef.org> | Sat Sep 08 11:12:33 2012 +0200 |
tree | f61600d04324ecb416d11a07b581c6dc15af2814 | |
parent | 7ff1822ec729fc389786683af886ea2f2b13cfbf [diff] [blame] |
Issue #15868: Fix refleak in bytesio.c (Coverity #715365).
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index ef951aa..4164533 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c
@@ -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);