Skip to content

Commit 2350a47

Browse files
bpo-33231: Fix potential leak in normalizestring() (pythonGH-6386)
(cherry picked from commit 0c1c456) Co-authored-by: INADA Naoki <[email protected]>
1 parent 8da15f0 commit 2350a47

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix potential memory leak in ``normalizestring()``.

Python/codecs.c

-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ PyObject *normalizestring(const char *string)
7777
}
7878
p[i] = '\0';
7979
v = PyUnicode_FromString(p);
80-
if (v == NULL)
81-
return NULL;
8280
PyMem_Free(p);
8381
return v;
8482
}

0 commit comments

Comments
 (0)