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
58bb82e7
Commit
58bb82e7
authored
Apr 01, 2012
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13019: Fix potential reference leaks in bytearray.extend().
Patch by Suman Saha.
parent
165a2c2e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
Misc/NEWS
Misc/NEWS
+3
-0
Objects/bytearrayobject.c
Objects/bytearrayobject.c
+6
-2
No files found.
Misc/NEWS
View file @
58bb82e7
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.2.4
Core and Builtins
-----------------
- Issue #13019: Fix potential reference leaks in bytearray.extend(). Patch
by Suman Saha.
- Issue #14378: Fix compiling ast.ImportFrom nodes with a "__future__" string as
the module name that was not interned.
...
...
Objects/bytearrayobject.c
View file @
58bb82e7
...
...
@@ -2234,8 +2234,10 @@ bytearray_extend(PyByteArrayObject *self, PyObject *arg)
}
bytearray_obj
=
PyByteArray_FromStringAndSize
(
NULL
,
buf_size
);
if
(
bytearray_obj
==
NULL
)
if
(
bytearray_obj
==
NULL
)
{
Py_DECREF
(
it
);
return
NULL
;
}
buf
=
PyByteArray_AS_STRING
(
bytearray_obj
);
while
((
item
=
PyIter_Next
(
it
))
!=
NULL
)
{
...
...
@@ -2268,8 +2270,10 @@ bytearray_extend(PyByteArrayObject *self, PyObject *arg)
return
NULL
;
}
if
(
bytearray_setslice
(
self
,
Py_SIZE
(
self
),
Py_SIZE
(
self
),
bytearray_obj
)
==
-
1
)
if
(
bytearray_setslice
(
self
,
Py_SIZE
(
self
),
Py_SIZE
(
self
),
bytearray_obj
)
==
-
1
)
{
Py_DECREF
(
bytearray_obj
);
return
NULL
;
}
Py_DECREF
(
bytearray_obj
);
Py_RETURN_NONE
;
...
...
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