提交 b355733a 编写于 作者: M Max Bruckner 提交者: GitHub

Merge pull request #43 from rvagg/malloc-err

don't ignore malloc failure in cJSON_PrintBuffered
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册