diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-30 22:20:49 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-30 22:20:49 (GMT) |
commit | fbc3e374a6b1856ca8e9041b9871d66126a1a1ab (patch) | |
tree | 37eec0ece616c90ec3c5774e09bc3e7d9eb6fa39 | |
parent | 78122c9c5d9a24bdc7083d9bd8e78a072ede2f42 (diff) | |
parent | 77a61d292aaeb94e63ef251d458540a5bdf655a9 (diff) | |
download | cpython-fbc3e374a6b1856ca8e9041b9871d66126a1a1ab.zip cpython-fbc3e374a6b1856ca8e9041b9871d66126a1a1ab.tar.gz cpython-fbc3e374a6b1856ca8e9041b9871d66126a1a1ab.tar.bz2 |
Fixed reference leak when read truncated pickle.
-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 c22b6c8..3ddf6a0 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -5247,8 +5247,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); |