Issue #15868: Fix refleak in bytesio.c (Coverity #715365).

This commit is contained in:
Stefan Krah 2012-09-08 11:12:33 +02:00
parent 7ff1822ec7
commit 96efdd422c
1 changed files with 3 additions and 1 deletions

View File

@ -692,8 +692,10 @@ bytesio_getstate(bytesio *self)
}
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);