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

Function pkg_str_dup

ut.h:971–983  ·  view source on GitHub ↗

* Make a copy of a str structure using pkg_malloc */

Source from the content-addressed store, hash-verified

969 * Make a copy of a str structure using pkg_malloc
970 */
971static inline int pkg_str_dup(str* dst, const str* src)
972{
973 dst->s = pkg_malloc(src->len);
974 if (!dst->s) {
975 LM_ERR("no private memory left\n");
976 dst->len = 0;
977 return -1;
978 }
979
980 memcpy(dst->s, src->s, src->len);
981 dst->len = src->len;
982 return 0;
983}
984
985static inline char *pkg_strdup(const char *str)
986{

Callers 15

pv_set_sdp_lineFunction · 0.85
pv_set_sdp_streamFunction · 0.85
pv_set_sdp_sessionFunction · 0.85
route_params_expandFunction · 0.85
init_log_cee_hostnameFunction · 0.85
fixup_iter_paramFunction · 0.85
pv_parse_dfks_nameFunction · 0.85
pv_set_dfksFunction · 0.85
build_full_notifyFunction · 0.85
parse_subscribe_xmlFunction · 0.85
build_feature_notifyFunction · 0.85
mi_feature_notifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected