Skip to content

Commit

Permalink
xhttp: proper check for return of add lump rpl
Browse files Browse the repository at this point in the history
(cherry picked from commit 9136ce8)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent 41ab1e8 commit 707ab98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modules/xhttp/xhttp_mod.c
Expand Up @@ -354,11 +354,12 @@ static int xhttp_handler(sip_msg_t* msg)
} else {
DBG("new fake msg created (%d bytes):\n<%.*s>\n",
fake_msg_len, fake_msg_len, fake_msg);
if (xhttp_process_request(msg, fake_msg, fake_msg_len)<0)
if (xhttp_process_request(msg, fake_msg, fake_msg_len)<0) {
ret=NONSIP_MSG_ERROR;
pkg_free(fake_msg);
}
return ret;
pkg_free(fake_msg);
}
return ret;
} else {
LM_DBG("http msg unchanged (%d bytes):\n<%.*s>\n",
msg->len, msg->len, msg->buf);
Expand Down Expand Up @@ -404,7 +405,7 @@ static int xhttp_send_reply(sip_msg_t *msg, int code, str *reason,

if(body!=NULL && body->len>0)
{
if (add_lump_rpl(msg, body->s, body->len, LUMP_RPL_BODY) < 0)
if (add_lump_rpl(msg, body->s, body->len, LUMP_RPL_BODY) == 0)
{
LM_ERR("Error while adding reply lump\n");
return -1;
Expand Down

0 comments on commit 707ab98

Please sign in to comment.