Commit ae891daf authored by Serhiy Storchaka's avatar Serhiy Storchaka

Fixed reference leak when read truncated pickle.

parent 0096a049
...@@ -5115,8 +5115,10 @@ load_inst(UnpicklerObject *self) ...@@ -5115,8 +5115,10 @@ load_inst(UnpicklerObject *self)
return -1; return -1;
if ((len = _Unpickler_Readline(self, &s)) >= 0) { if ((len = _Unpickler_Readline(self, &s)) >= 0) {
if (len < 2) if (len < 2) {
Py_DECREF(module_name);
return bad_readline(); return bad_readline();
}
class_name = PyUnicode_DecodeASCII(s, len - 1, "strict"); class_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
if (class_name != NULL) { if (class_name != NULL) {
cls = find_class(self, module_name, class_name); cls = find_class(self, module_name, class_name);
......
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