summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-30 22:18:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-30 22:18:23 (GMT)
commitca28eba3d3656bab394f846f9357227d227059ec (patch)
tree15142a2f22e2a234ff392af01f3a195d7f65a41e /Modules
parentcbbec1c53f4b6fb88b4ae984e69db2d2951cd560 (diff)
downloadcpython-ca28eba3d3656bab394f846f9357227d227059ec.zip
cpython-ca28eba3d3656bab394f846f9357227d227059ec.tar.gz
cpython-ca28eba3d3656bab394f846f9357227d227059ec.tar.bz2
Fixed reference leak when read truncated pickle.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_pickle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 6ff16bb..c357dcc 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -5115,8 +5115,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);