summaryrefslogtreecommitdiff
path: root/Python/codecs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/codecs.c')
-rw-r--r--Python/codecs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/codecs.c b/Python/codecs.c
index 002fad3080..ff2142df40 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -129,8 +129,10 @@ PyObject *_PyCodec_Lookup(const char *encoding)
/* Next, scan the search functions in order of registration */
args = PyTuple_New(1);
- if (args == NULL)
- goto onError;
+ if (args == NULL) {
+ Py_DECREF(v);
+ return NULL;
+ }
PyTuple_SET_ITEM(args,0,v);
len = PyList_Size(interp->codec_search_path);