MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cJSON_AddItemToObject

Function cJSON_AddItemToObject

lib/cJSON.c:1905–1920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1903}
1904
1905void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item)
1906{
1907 if (!item)
1908 {
1909 return;
1910 }
1911
1912 /* free old key and set new one */
1913 if (item->string)
1914 {
1915 cJSON_free(item->string);
1916 }
1917 item->string = (char*)cJSON_strdup((const unsigned char*)string);
1918
1919 cJSON_AddItemToArray(object,item);
1920}
1921
1922/* Add an item to an object with constant string as key */
1923void cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item)

Callers 4

merge_patchFunction · 0.70
payload_add_paramsFunction · 0.50
evi_build_payloadFunction · 0.50

Calls 2

cJSON_strdupFunction · 0.70
cJSON_AddItemToArrayFunction · 0.70

Tested by

no test coverage detected