提交 1df987a1 编写于 作者: M Max Bruckner

cJSON_strdup: Check for NULL string

上级 ddadb44a
......@@ -88,6 +88,11 @@ static char* cJSON_strdup(const char* str)
size_t len = 0;
char *copy = NULL;
if (str == NULL)
{
return NULL;
}
len = strlen(str) + 1;
if (!(copy = (char*)cJSON_malloc(len)))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册