Kaydet (Commit) 96efdd42 authored tarafından Stefan Krah's avatar Stefan Krah

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

üst 7ff1822e
...@@ -692,9 +692,11 @@ bytesio_getstate(bytesio *self) ...@@ -692,9 +692,11 @@ 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);
Py_DECREF(initvalue); Py_DECREF(initvalue);
......
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