Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
c0a83741
Commit
c0a83741
authored
Feb 11, 2014
by
Paul Sokolovsky
Browse files
gc: Don't segfault if gc_realloc() fails.
parent
a075741c
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/gc.c
View file @
c0a83741
...
...
@@ -332,6 +332,9 @@ void *gc_realloc(void *ptr, machine_uint_t n_bytes) {
}
else
{
// TODO check if we can grow inplace
void
*
ptr2
=
gc_alloc
(
n_bytes
);
if
(
ptr2
==
NULL
)
{
return
ptr2
;
}
memcpy
(
ptr2
,
ptr
,
n_existing
);
gc_free
(
ptr
);
return
ptr2
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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