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
21fe7213
Commit
21fe7213
authored
Jan 03, 2017
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed possible reference leaks in the _json module.
parent
d9cb1b0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
Modules/_json.c
Modules/_json.c
+9
-4
No files found.
Modules/_json.c
View file @
21fe7213
...
...
@@ -845,14 +845,16 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
int
kind
;
Py_ssize_t
end_idx
;
PyObject
*
val
=
NULL
;
PyObject
*
rval
=
PyList_New
(
0
)
;
PyObject
*
rval
;
Py_ssize_t
next_idx
;
if
(
rval
==
NULL
)
return
NULL
;
if
(
PyUnicode_READY
(
pystr
)
==
-
1
)
return
NULL
;
rval
=
PyList_New
(
0
);
if
(
rval
==
NULL
)
return
NULL
;
str
=
PyUnicode_DATA
(
pystr
);
kind
=
PyUnicode_KIND
(
pystr
);
end_idx
=
PyUnicode_GET_LENGTH
(
pystr
)
-
1
;
...
...
@@ -1559,8 +1561,11 @@ encoder_listencode_obj(PyEncoderObject *s, _PyAccu *acc,
return
-
1
;
}
if
(
Py_EnterRecursiveCall
(
" while encoding a JSON object"
))
if
(
Py_EnterRecursiveCall
(
" while encoding a JSON object"
))
{
Py_DECREF
(
newobj
);
Py_XDECREF
(
ident
);
return
-
1
;
}
rv
=
encoder_listencode_obj
(
s
,
acc
,
newobj
,
indent_level
);
Py_LeaveRecursiveCall
();
...
...
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