Skip to content

Commit 0c1c456

Browse files
authored
bpo-33231: Fix potential leak in normalizestring() (pythonGH-6386)
1 parent 01b731f commit 0c1c456

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)