Skip to content

Commit

Permalink
fixing coverity found defects - processing initialized variables, con…
Browse files Browse the repository at this point in the history
…trol flow, invalid expressions

(cherry picked from commit b22844e)

Conflicts:
	modules/drouting/drouting.c
  • Loading branch information
ph4r05 authored and liviuchircu committed Jan 14, 2016
1 parent 21083e8 commit 50737ff
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules/auth/challenge.c
Expand Up @@ -145,7 +145,7 @@ static inline int challenge(struct sip_msg* _msg, gparam_p _realm, int _qop,
int _code, char* _message, char* _challenge_msg)
{
int auth_hf_len;
struct hdr_field* h;
struct hdr_field* h = NULL;
auth_body_t* cred = 0;
char *auth_hf;
int ret;
Expand Down
2 changes: 1 addition & 1 deletion modules/drouting/drouting.c
Expand Up @@ -2070,7 +2070,7 @@ static int use_next_gw_w_part(struct sip_msg* msg,
pv_value_t pv_val;
str ruri;
dr_part_group_t * part_grp;
int ok;
int ok = 0;
pgw_t * dst;
struct socket_info *sock;

Expand Down
4 changes: 2 additions & 2 deletions modules/pua/send_subscribe.c
Expand Up @@ -664,7 +664,7 @@ ua_pres_t* subscribe_cbparam(subs_info_t* subs, int ua_flag)

hentity->flag= subs->source_flag;
hentity->event= subs->event;
hentity->ua_flag= hentity->ua_flag;
hentity->ua_flag= ua_flag;
hentity->cb_param= subs->cb_param;
return hentity;

Expand Down Expand Up @@ -769,7 +769,7 @@ ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag)

hentity->flag= subs->flag;
hentity->event= subs->event;
hentity->ua_flag= hentity->ua_flag;
hentity->ua_flag= ua_flag;
hentity->cb_param= subs->cb_param;
hentity->hash_index = subs->hash_index;
hentity->local_index = subs->local_index;
Expand Down
2 changes: 1 addition & 1 deletion modules/uac/uac.c
Expand Up @@ -419,7 +419,7 @@ static int w_replace_from(struct sip_msg* msg, char* p1, char* p2)
str uri_s;
str dsp_s;
str *uri;
str *dsp;
str *dsp = NULL;

if (p2==NULL) {
p2 = p1;
Expand Down
2 changes: 1 addition & 1 deletion modules/usrloc/ucontact.c
Expand Up @@ -59,7 +59,7 @@ extern event_id_t ei_c_update_id;
*/
static int compute_next_hop(ucontact_t *contact)
{
str uri;
str uri = {0,0};
struct sip_uri puri;

if (contact->path.s && contact->path.len > 0) {
Expand Down
2 changes: 1 addition & 1 deletion proxy.c
Expand Up @@ -76,7 +76,7 @@ int hostent_shm_cpy(struct hostent *dst, struct hostent* src)
p += src->h_length;
}

dst->h_addr = dst->h_addr_list[0];
dst->h_addr = src->h_addr_list[0];
dst->h_addrtype = src->h_addrtype;
dst->h_length = src->h_length;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion rw_locking.h
Expand Up @@ -29,7 +29,7 @@ inline static rw_lock_t * lock_init_rw(void)

return new_lock;
error:
if (new_lock->lock)
if (new_lock!=NULL && new_lock->lock)
lock_dealloc(new_lock->lock);
if (new_lock)
shm_free(new_lock);
Expand Down

0 comments on commit 50737ff

Please sign in to comment.