Skip to content

Commit

Permalink
carrierroute: proper str pointer when adding fields to rpc structure
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jan 6, 2017
1 parent 82acaac commit a05f582
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/modules/carrierroute/cr_fifo.c
Expand Up @@ -1185,11 +1185,13 @@ void cr_rpc_dump_routes(rpc_t* rpc, void* ctx)
goto error;
}
tmp_str = (rd->carriers[i] ? rd->carriers[i]->name : &empty_str);
if(rpc->struct_add(dh, "Sd[", "carrier", &tmp_str,
if(rpc->struct_add(dh, "Sd[", "carrier", tmp_str,
"id", (rd->carriers[i] ? rd->carriers[i]->id : 0),
"domains", &eh)<0)
{
LM_ERR("add carrier structure failure at count %d\n", i);
LM_ERR("add carrier structure failure at count %d"
" (carrier: %d/%.*s)\n",
i, tmp_str->len, tmp_str->len, tmp_str->s);
rpc->fault(ctx, 500, "Internal error - carrier structure");
goto error;
}
Expand All @@ -1202,7 +1204,7 @@ void cr_rpc_dump_routes(rpc_t* rpc, void* ctx)
goto error;
}
tmp_str = (rd->carriers[i]->domains[j] ? rd->carriers[i]->domains[j]->name : &empty_str);
if(rpc->struct_add(fh, "Sd[", "domain", &tmp_str,
if(rpc->struct_add(fh, "Sd[", "domain", tmp_str,
"id", rd->carriers[i]->domains[j]->id,
"data", &gh)<0)
{
Expand Down

0 comments on commit a05f582

Please sign in to comment.