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
ad887cf7
Commit
ad887cf7
authored
May 16, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix possible refleak in MAKE_FUNCTION (closes #26991)
Patch by Xiang Zhang.
parent
0495fa81
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
Misc/NEWS
Misc/NEWS
+2
-0
Python/ceval.c
Python/ceval.c
+3
-1
No files found.
Misc/NEWS
View file @
ad887cf7
...
...
@@ -10,6 +10,8 @@ Release date: tba
Core and Builtins
-----------------
- Issue #26991: Fix possible refleak when creating a function with annotations.
- Issue #27039: Fixed bytearray.remove() for values greater than 127. Patch by
Joe Jevnik.
...
...
Python/ceval.c
View file @
ad887cf7
...
...
@@ -3284,6 +3284,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
PyObject
*
anns
=
PyDict_New
();
if
(
anns
==
NULL
)
{
Py_DECREF
(
func
);
Py_DECREF
(
names
);
goto
error
;
}
name_ix
=
PyTuple_Size
(
names
);
...
...
@@ -3299,9 +3300,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if
(
err
!=
0
)
{
Py_DECREF
(
anns
);
Py_DECREF
(
func
);
Py_DECREF
(
names
);
goto
error
;
}
}
Py_DECREF
(
names
);
if
(
PyFunction_SetAnnotations
(
func
,
anns
)
!=
0
)
{
/* Can't happen unless
...
...
@@ -3311,7 +3314,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
goto
error
;
}
Py_DECREF
(
anns
);
Py_DECREF
(
names
);
}
/* XXX Maybe this should be a separate opcode? */
...
...
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