summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/_pickle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 6125c25..41f1cd1 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -5184,8 +5184,10 @@ load_inst(UnpicklerObject *self)
return -1;
if ((len = _Unpickler_Readline(self, &s)) >= 0) {
- if (len < 2)
+ if (len < 2) {
+ Py_DECREF(module_name);
return bad_readline();
+ }
class_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
if (class_name != NULL) {
cls = find_class(self, module_name, class_name);