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
fe2e8395
Commit
fe2e8395
authored
Jul 11, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reference leaks introduced by the patch for issue #5308.
parent
8cedb89c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
Python/marshal.c
Python/marshal.c
+11
-9
No files found.
Python/marshal.c
View file @
fe2e8395
...
...
@@ -88,7 +88,7 @@ w_more(int c, WFILE *p)
}
static
void
w_string
(
char
*
s
,
Py_ssize_t
n
,
WFILE
*
p
)
w_string
(
c
onst
c
har
*
s
,
Py_ssize_t
n
,
WFILE
*
p
)
{
if
(
p
->
fp
!=
NULL
)
{
fwrite
(
s
,
1
,
n
,
p
->
fp
);
...
...
@@ -141,6 +141,13 @@ w_long64(long x, WFILE *p)
# define W_SIZE w_long
#endif
static
void
w_pstring
(
const
char
*
s
,
Py_ssize_t
n
,
WFILE
*
p
)
{
W_SIZE
(
n
,
p
);
w_string
(
s
,
n
,
p
);
}
/* We assume that Python longs are stored internally in base some power of
2**15; for the sake of portability we'll always read and write them in base
exactly 2**15. */
...
...
@@ -338,9 +345,7 @@ w_object(PyObject *v, WFILE *p)
else
{
w_byte
(
TYPE_STRING
,
p
);
}
n
=
PyString_GET_SIZE
(
v
);
W_SIZE
(
n
,
p
);
w_string
(
PyString_AS_STRING
(
v
),
n
,
p
);
w_pstring
(
PyBytes_AS_STRING
(
v
),
PyString_GET_SIZE
(
v
),
p
);
}
#ifdef Py_USING_UNICODE
else
if
(
PyUnicode_CheckExact
(
v
))
{
...
...
@@ -352,9 +357,7 @@ w_object(PyObject *v, WFILE *p)
return
;
}
w_byte
(
TYPE_UNICODE
,
p
);
n
=
PyString_GET_SIZE
(
utf8
);
W_SIZE
(
n
,
p
);
w_string
(
PyString_AS_STRING
(
utf8
),
n
,
p
);
w_pstring
(
PyString_AS_STRING
(
utf8
),
PyString_GET_SIZE
(
utf8
),
p
);
Py_DECREF
(
utf8
);
}
#endif
...
...
@@ -441,8 +444,7 @@ w_object(PyObject *v, WFILE *p)
PyBufferProcs
*
pb
=
v
->
ob_type
->
tp_as_buffer
;
w_byte
(
TYPE_STRING
,
p
);
n
=
(
*
pb
->
bf_getreadbuffer
)(
v
,
0
,
(
void
**
)
&
s
);
W_SIZE
(
n
,
p
);
w_string
(
s
,
n
,
p
);
w_pstring
(
s
,
n
,
p
);
}
else
{
w_byte
(
TYPE_UNKNOWN
,
p
);
...
...
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