handle null pointer: compose_patch

This commit is contained in:
Max Bruckner 2017-06-28 16:00:14 +02:00
parent c46c4d1559
commit 2d252ae595
1 changed files with 8 additions and 1 deletions

View File

@ -1043,7 +1043,14 @@ CJSON_PUBLIC(int) cJSONUtils_ApplyPatchesCaseSensitive(cJSON * const object, con
static void compose_patch(cJSON * const patches, const unsigned char * const operation, const unsigned char * const path, const unsigned char *suffix, const cJSON * const value)
{
cJSON *patch = cJSON_CreateObject();
cJSON *patch = NULL;
if ((patches == NULL) || (operation == NULL) || (path == NULL))
{
return;
}
patch = cJSON_CreateObject();
if (patch == NULL)
{
return;