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

Function _cJSON_AddItemToObject

lib/cJSON.c:1888–1903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1886}
1887
1888void _cJSON_AddItemToObject(cJSON *object, const str *string, cJSON *item)
1889{
1890 if (!item)
1891 {
1892 return;
1893 }
1894
1895 /* free old key and set new one */
1896 if (item->string)
1897 {
1898 cJSON_free(item->string);
1899 }
1900 item->string = (char*)cJSON_strndup((const unsigned char*)string->s, string->len);
1901
1902 cJSON_AddItemToArray(object,item);
1903}
1904
1905void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item)
1906{

Callers 5

_add_mi_itemFunction · 0.85
push_kv_to_jsonFunction · 0.85
on_header_callbackFunction · 0.85
bson2jsonFunction · 0.85
payload_add_paramsFunction · 0.85

Calls 2

cJSON_strndupFunction · 0.85
cJSON_AddItemToArrayFunction · 0.70

Tested by

no test coverage detected