mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
SF patch #1467512, fix double free with triple quoted string in standard build.
This was the result of inconsistent use of PyMem_* and PyObject_* allocators. By changing to use PyObject_* allocator almost everywhere, this removes the inconsistency.
This commit is contained in:
parent
65c05b20e9
commit
2c4e4f9839
9 changed files with 45 additions and 37 deletions
|
@ -8,7 +8,7 @@ bitset
|
|||
newbitset(int nbits)
|
||||
{
|
||||
int nbytes = NBYTES(nbits);
|
||||
bitset ss = PyMem_NEW(BYTE, nbytes);
|
||||
bitset ss = PyObject_MALLOC(sizeof(BYTE) * nbytes);
|
||||
|
||||
if (ss == NULL)
|
||||
Py_FatalError("no mem for bitset");
|
||||
|
@ -22,7 +22,7 @@ newbitset(int nbits)
|
|||
void
|
||||
delbitset(bitset ss)
|
||||
{
|
||||
PyMem_DEL(ss);
|
||||
PyObject_FREE(ss);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue