Skip to content

Commit

Permalink
Revert "p_usrloc: str->s string NULL check before str_dup"
Browse files Browse the repository at this point in the history
This reverts commit d1c6dc6.
  • Loading branch information
linuxmaniac committed Nov 23, 2015
1 parent d1c6dc6 commit 90d5a98
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions modules/p_usrloc/ucontact.c
Expand Up @@ -60,31 +60,20 @@ ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _
}
memset(c, 0, sizeof(ucontact_t));

if (_contact->s && _contact->len > 0) {
if (shm_str_dup( &c->c, _contact) < 0) goto error;
}

if (_ci->callid->s && _ci->callid->len > 0) {
if (shm_str_dup( &c->callid, _ci->callid) < 0) goto error;
}

if (_ci->user_agent->s && _ci->user_agent->len > 0) {
if (shm_str_dup( &c->user_agent, _ci->user_agent) < 0) goto error;
}
if (shm_str_dup( &c->c, _contact) < 0) goto error;
if (shm_str_dup( &c->callid, _ci->callid) < 0) goto error;
if (shm_str_dup( &c->user_agent, _ci->user_agent) < 0) goto error;

if (_ci->received.s && _ci->received.len > 0) {
if (_ci->received.s && _ci->received.len) {
if (shm_str_dup( &c->received, &_ci->received) < 0) goto error;
}

if (_ci->path && _ci->path->len > 0) {
if (_ci->path && _ci->path->len) {
if (shm_str_dup( &c->path, _ci->path) < 0) goto error;
}

if (_ci->ruid.s && _ci->ruid.len > 0) {
if (_ci->ruid.s && _ci->ruid.len) {
if (shm_str_dup( &c->ruid, &_ci->ruid) < 0) goto error;
}

if (_ci->instance.s && _ci->instance.len > 0) {
if (_ci->instance.s && _ci->instance.len) {
if (shm_str_dup( &c->instance, &_ci->instance) < 0) goto error;
}

Expand Down

0 comments on commit 90d5a98

Please sign in to comment.