Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8eda5f7c
Commit
8eda5f7c
authored
Mar 02, 2011
by
Daniel Stutzbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#11335: Fix memory leak when a sort key function throws an exception
parent
2f283c2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
Misc/NEWS
Misc/NEWS
+3
-0
Objects/listobject.c
Objects/listobject.c
+2
-0
No files found.
Misc/NEWS
View file @
8eda5f7c
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
- Issue #11335: Fixed a memory leak in list.sort when the key function
throws an exception.
- Issue #8923: When a string is encoded to UTF-8 in strict mode, the result is
cached into the object. Examples: str.encode(), str.encode('
utf
-
8
'),
PyUnicode_AsUTF8String() and PyUnicode_AsEncodedString(unicode, "utf-8",
...
...
Objects/listobject.c
View file @
8eda5f7c
...
...
@@ -1957,6 +1957,8 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
if
(
keys
[
i
]
==
NULL
)
{
for
(
i
=
i
-
1
;
i
>=
0
;
i
--
)
Py_DECREF
(
keys
[
i
]);
if
(
keys
!=
&
ms
.
temparray
[
saved_ob_size
+
1
])
PyMem_FREE
(
keys
);
goto
keyfunc_fail
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment