From 17db4b99b4d300a9b024ba0efdaa46d05d4f4cd3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 21 Apr 2017 10:55:54 +0300 Subject: [PATCH] [3.5] bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (GH-1217) (#1219) (cherry picked from commit 7a113a0) --- Objects/unicodeobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d7c9a34c39..d037d80b3d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3654,6 +3654,7 @@ PyUnicode_FSDecoder(PyObject* arg, void* addr) PyObject *output = NULL; if (arg == NULL) { Py_DECREF(*(PyObject**)addr); + *(PyObject**)addr = NULL; return 1; } if (PyUnicode_Check(arg)) { -- 2.40.0