diff options
author | Walter Dörwald <walter@livinglogic.de> | 2006-03-18 14:05:43 +0000 |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2006-03-18 14:05:43 +0000 |
commit | ba8e180f3be1cd43954c7e87a45488c46f316e51 (patch) | |
tree | fe62431484c719731292968ac77b35ee1dce6ee1 /Python/codecs.c | |
parent | f4063ca8bc632311974f3c5225d868183c653401 (diff) | |
download | cpython-git-ba8e180f3be1cd43954c7e87a45488c46f316e51.tar.gz |
Release codecs variable earlier.
Diffstat (limited to 'Python/codecs.c')
-rw-r--r-- | Python/codecs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index 532f1a6772..e2bb8fcbbf 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -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); + 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; } |