Skip to content

Commit 64421d9

Browse files
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
(cherry picked from commit 0c1c456) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
1 parent 28c1790 commit 64421d9

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix potential memory leak in ``normalizestring()``.

Python/codecs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ PyObject *normalizestring(const char *string)
7878
}
7979
p[i] = '\0';
8080
v = PyUnicode_FromString(p);
81-
if (v == NULL)
82-
return NULL;
8381
PyMem_Free(p);
8482
return v;
8583
}

0 commit comments

Comments
 (0)