]> granicus.if.org Git - python/commitdiff
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
authorINADA Naoki <methane@users.noreply.github.com>
Fri, 6 Apr 2018 06:51:24 +0000 (15:51 +0900)
committerGitHub <noreply@github.com>
Fri, 6 Apr 2018 06:51:24 +0000 (15:51 +0900)
Misc/NEWS.d/next/Core and Builtins/2018-04-05-22-20-44.bpo-33231.3Jmo0q.rst [new file with mode: 0644]
Python/codecs.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-04-05-22-20-44.bpo-33231.3Jmo0q.rst b/Misc/NEWS.d/next/Core and Builtins/2018-04-05-22-20-44.bpo-33231.3Jmo0q.rst
new file mode 100644 (file)
index 0000000..de54fbb
--- /dev/null
@@ -0,0 +1 @@
+Fix potential memory leak in ``normalizestring()``.
index 223ccca603fcf59013e141424fcf2ac0e7e66d08..eb3cd35fb8e249a2506e221bebdb2d7d68be8233 100644 (file)
@@ -78,8 +78,6 @@ PyObject *normalizestring(const char *string)
     }
     p[i] = '\0';
     v = PyUnicode_FromString(p);
-    if (v == NULL)
-        return NULL;
     PyMem_Free(p);
     return v;
 }