Skip to content

Commit

Permalink
Fixed testing the return code for pv_set_value()
Browse files Browse the repository at this point in the history
(cherry picked from commit c9cf640)
  • Loading branch information
bogdan-iancu committed Apr 21, 2017
1 parent cf73b68 commit 7a6a453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/dialog/dialog.c
Expand Up @@ -1575,13 +1575,13 @@ static int w_get_dlg_vals(struct sip_msg *msg, char *v_name, char *v_val,
/* add name to AVP */
val.flags = PV_VAL_STR;
val.rs = dv->name;
if ( !pv_set_value( msg, (pv_spec_p)v_name, 0, &val) ) {
if ( pv_set_value( msg, (pv_spec_p)v_name, 0, &val)<0 ) {
LM_ERR("failed to add new name in dlg val list, ignoring\n");
} else {
/* add value to AVP */
val.flags = PV_VAL_STR;
val.rs = dv->val;
if ( !pv_set_value( msg, (pv_spec_p)v_val, 0, &val) ) {
if ( pv_set_value( msg, (pv_spec_p)v_val, 0, &val)<0 ) {
LM_ERR("failed to add new value in dlg val list, ignoring\n");
/* better exit here, as we will desync the lists */
unref_dlg(dlg, 1);
Expand Down

0 comments on commit 7a6a453

Please sign in to comment.