Commit 5741327e authored by Neal Norwitz's avatar Neal Norwitz

Handle error

parent cbdfaf7e
......@@ -167,7 +167,10 @@ PyObject *_PyCodec_Lookup(const char *encoding)
}
/* Cache and return the result */
PyDict_SetItem(interp->codec_search_cache, v, result);
if (PyDict_SetItem(interp->codec_search_cache, v, result) < 0) {
Py_DECREF(result);
goto onError;
}
Py_DECREF(args);
return result;
......
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