Skip to content

Commit

Permalink
cgrates: fix useless null check
Browse files Browse the repository at this point in the history
Fixes Coverity CID #200007 and #200082
  • Loading branch information
razvancrainea committed Jul 20, 2020
1 parent 0394012 commit 20d5893
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/cgrates/cgrates_acc.c
Expand Up @@ -378,7 +378,7 @@ static json_object *cgr_get_start_acc_msg(struct sip_msg *msg,

/* ask to init the call */
if (!cgre_compat_mode &&
((s && !cgr_get_const_kv(&s->req_kvs, "InitSession")) || !s) &&
!cgr_get_const_kv(&s->req_kvs, "InitSession") &&
cgr_obj_push_bool(cmsg->opts, "InitSession", 1) < 0) {
LM_ERR("cannot push InitSession to request opts!\n");
goto error;
Expand Down Expand Up @@ -504,7 +504,7 @@ static json_object *cgr_get_stop_acc_msg(struct sip_msg *msg,

/* ask to terminate the call */
if (!cgre_compat_mode &&
((s && !cgr_get_const_kv(&s->req_kvs, "TerminateSession")) || !s) &&
!cgr_get_const_kv(&s->req_kvs, "TerminateSession") &&
cgr_obj_push_bool(cmsg->opts, "TerminateSession", 1) < 0) {
LM_ERR("cannot push TerminateSession to request opts!\n");
goto error;
Expand Down

0 comments on commit 20d5893

Please sign in to comment.