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

Function bencode_dictionary_get_string_dup

modules/rtpengine/bencode.h:463–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463static inline char *bencode_dictionary_get_string_dup(bencode_item_t *dict, const char *key, int *len) {
464 const char *s;
465 char *ret;
466 s = bencode_dictionary_get_string(dict, key, len);
467 if (!s)
468 return NULL;
469 ret = BENCODE_MALLOC(*len);
470 if (!ret)
471 return NULL;
472 memcpy(ret, s, *len);
473 return ret;
474}
475
476static inline char *bencode_dictionary_get_str_dup(bencode_item_t *dict, const char *key, str *str) {
477 str->s = bencode_dictionary_get_string_dup(dict, key, &str->len);

Callers 1

Calls 1

Tested by

no test coverage detected