mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issues/88027: A potential double free in list_sort_impl (GH-92367)
merge_freemem(): set keys to NULL do it's harmless to call this again.
(cherry picked from commit 9652900969
)
Co-authored-by: Tim Peters <tim.peters@gmail.com>
This commit is contained in:
parent
2a2421e538
commit
0eef443f01
1 changed files with 3 additions and 1 deletions
|
@ -1548,8 +1548,10 @@ static void
|
|||
merge_freemem(MergeState *ms)
|
||||
{
|
||||
assert(ms != NULL);
|
||||
if (ms->a.keys != ms->temparray)
|
||||
if (ms->a.keys != ms->temparray) {
|
||||
PyMem_Free(ms->a.keys);
|
||||
ms->a.keys = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure enough temp memory for 'need' array slots is available.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue