mirror of
https://github.com/python/cpython.git
synced 2025-10-14 10:53:40 +00:00
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
(cherry picked from commit 0c1c4563a6
)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
This commit is contained in:
parent
28c179094b
commit
64421d9237
2 changed files with 1 additions and 2 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fix potential memory leak in ``normalizestring()``.
|
|
@ -78,8 +78,6 @@ PyObject *normalizestring(const char *string)
|
||||||
}
|
}
|
||||||
p[i] = '\0';
|
p[i] = '\0';
|
||||||
v = PyUnicode_FromString(p);
|
v = PyUnicode_FromString(p);
|
||||||
if (v == NULL)
|
|
||||||
return NULL;
|
|
||||||
PyMem_Free(p);
|
PyMem_Free(p);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue