mirror of https://github.com/python/cpython
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
This commit is contained in:
parent
01b731fc2b
commit
0c1c4563a6
|
@ -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…
Reference in New Issue