]> granicus.if.org Git - python/commitdiff
[3.5] bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (GH-1217) (...
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 21 Apr 2017 07:55:54 +0000 (10:55 +0300)
committerGitHub <noreply@github.com>
Fri, 21 Apr 2017 07:55:54 +0000 (10:55 +0300)
(cherry picked from commit 7a113a0)

Objects/unicodeobject.c

index d7c9a34c39451b761c87a25595daa81c413dc781..d037d80b3d222e5f2042d7917dc92e22ebf1a294 100644 (file)
@@ -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)) {