Release codecs variable earlier.

This commit is contained in:
Walter Dörwald 2006-03-18 14:05:43 +00:00
parent f4063ca8bc
commit ba8e180f3b
1 changed files with 2 additions and 4 deletions

View File

@ -230,16 +230,14 @@ PyObject *codec_getincrementalcodec(const char *encoding,
if (codecs == NULL)
return NULL;
inccodec = PyObject_GetAttrString(codecs, attrname);
if (inccodec == NULL) {
Py_DECREF(codecs);
if (inccodec == NULL)
return NULL;
}
if (errors)
ret = PyObject_CallFunction(inccodec, "s", errors);
else
ret = PyObject_CallFunction(inccodec, NULL);
Py_DECREF(inccodec);
Py_DECREF(codecs);
return ret;
}