mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
json patch: adding to a subfield of a non-object now fails as expected
This commit is contained in:
@@ -988,6 +988,12 @@ static int apply_patch(cJSON *object, const cJSON *patch, const cJSON_bool case_
|
||||
cJSON_AddItemToObject(parent, (char*)child_pointer, value);
|
||||
value = NULL;
|
||||
}
|
||||
else /* parent is not an object */
|
||||
{
|
||||
/* Couldn't find object to add to. */
|
||||
status = 9;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (value != NULL)
|
||||
|
||||
Reference in New Issue
Block a user