Skip to content

Commit

Permalink
sipsess: fix coverity warnings
Browse files Browse the repository at this point in the history
remove unneccessary null check and remove dead code part that is covered
by sipsess_reply_xx functions.

fixes baresip#432
  • Loading branch information
maximilianfridrich committed Jul 13, 2022
1 parent 26ce397 commit 62a8f19
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
22 changes: 0 additions & 22 deletions src/sipsess/accept.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,6 @@ int sipsess_accept(struct sipsess **sessp, struct sipsess_sock *sock,
err = sipsess_reply_2xx(sess, msg, scode, reason, desc,
fmt, &ap);
}
else {
struct sip_contact contact;

sip_contact_set(&contact, sess->cuser, &msg->dst, msg->tp);

err = sip_treplyf(&sess->st, NULL, sess->sip,
msg, true, scode, reason,
"%H"
"%v"
"%s%s%s"
"Content-Length: %zu\r\n"
"\r\n"
"%b",
sip_contact_print, &contact,
fmt, &ap,
desc ? "Content-Type: " : "",
desc ? sess->ctype : "",
desc ? "\r\n" : "",
desc ? mbuf_get_left(desc) : (size_t)0,
desc ? mbuf_buf(desc) : NULL,
desc ? mbuf_get_left(desc) : (size_t)0);
}

va_end(ap);

Expand Down
2 changes: 1 addition & 1 deletion src/sipsess/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void invite_resp_handler(int err, const struct sip_msg *msg, void *arg)
if (sip_msg_hdr_has_value(msg, SIP_HDR_REQUIRE, "100rel")
&& sess->rel100_supported) {

if (msg && mbuf_get_left(msg->mb)) {
if (mbuf_get_left(msg->mb)) {
if (sess->sent_offer) {
sess->awaiting_answer = false;
err = sess->answerh(msg, sess->arg);
Expand Down

0 comments on commit 62a8f19

Please sign in to comment.