Commit 96efdd42 authored by Stefan Krah's avatar Stefan Krah

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

parent 7ff1822e
...@@ -692,8 +692,10 @@ bytesio_getstate(bytesio *self) ...@@ -692,8 +692,10 @@ bytesio_getstate(bytesio *self)
} }
else { else {
dict = PyDict_Copy(self->dict); dict = PyDict_Copy(self->dict);
if (dict == NULL) if (dict == NULL) {
Py_DECREF(initvalue);
return NULL; return NULL;
}
} }
state = Py_BuildValue("(OnN)", initvalue, self->pos, dict); state = Py_BuildValue("(OnN)", initvalue, self->pos, dict);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment