diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-30 22:20:36 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-30 22:20:36 (GMT) |
commit | 77a61d292aaeb94e63ef251d458540a5bdf655a9 (patch) | |
tree | 578e757def3bc3bfc0af277ae80983964be898da /Modules/_pickle.c | |
parent | b63015b01a07c535ef4c26fe0bc4c336295dd08e (diff) | |
parent | ca28eba3d3656bab394f846f9357227d227059ec (diff) | |
download | cpython-77a61d292aaeb94e63ef251d458540a5bdf655a9.zip cpython-77a61d292aaeb94e63ef251d458540a5bdf655a9.tar.gz cpython-77a61d292aaeb94e63ef251d458540a5bdf655a9.tar.bz2 |
Fixed reference leak when read truncated pickle.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r-- | Modules/_pickle.c | 4 |
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); |