mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Handle out of memory when printing string
This commit is contained in:
parent
8df4cd46eb
commit
6622c54f18
5
cJSON.c
5
cJSON.c
@ -1452,7 +1452,10 @@ static char *print_object(const cJSON *item, int depth, cjbool fmt, printbuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* print key */
|
/* print key */
|
||||||
print_string_ptr(child->string, p);
|
if (!print_string_ptr(child->string, p))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
p->offset = update(p);
|
p->offset = update(p);
|
||||||
|
|
||||||
len = fmt ? 2 : 1;
|
len = fmt ? 2 : 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user