Browse Source

Merge pull request #43 from rvagg/malloc-err

don't ignore malloc failure in cJSON_PrintBuffered
pull/42/merge
Max Bruckner 8 years ago
committed by GitHub
parent
commit
b355733aa1
  1. 4
      cJSON.c

4
cJSON.c

@ -845,6 +845,10 @@ char *cJSON_PrintBuffered(const cJSON *item, int prebuffer, int fmt)
{
printbuffer p;
p.buffer = (char*)cJSON_malloc(prebuffer);
if (!p.buffer)
{
return 0;
}
p.length = prebuffer;
p.offset = 0;

Loading…
Cancel
Save