cJSON_Parse() failure

Hi,

I am sending data from AWS and run it through cJSON_Parse(). If the message is just a little bigger than 1000 bytes, I will get the message "cJSON Parse failure". Debugging the code, function cJSON_ParseWithLengthOpts() will be the one that fails. I guess it likely has to do with lack of memory. The rows


item = cJSON_New_Item(&global_hooks);
if (item == NULL) /* memory fail */
{
    goto fail;
}

will not go to fail, but the result of the next rows will:

if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer))))
{
    /* parse failure. ep is set. */
    goto fail;
}

Is it lack of memory that causes this? If so, is it possible to increase available memory? I have tested to increase
CONFIG_HEAP_MEM_POOL_SIZE
CONFIG_MAIN_STACK_SIZE
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE
but it doesn't help.

Best regards,
Lars

Parents Reply Children
No Data
Related