Skip to content

Commit

Permalink
mid_registrar: extra check for anchor ops
Browse files Browse the repository at this point in the history
Fixes Coverity CID #180095
  • Loading branch information
razvancrainea committed Nov 24, 2017
1 parent 5dd573a commit 958a4df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/mid_registrar/save.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ static inline int save_restore_req_contacts(struct sip_msg *req, struct sip_msg*
len += sprintf(buf + len, "\r\n");

anchor = anchor_lump(rpl, rpl->unparsed - rpl->buf, 0);
if (insert_new_lump_after(anchor, buf, len, HDR_CONTACT_T) == NULL) {
if (!anchor || insert_new_lump_after(anchor, buf, len, HDR_CONTACT_T) == NULL) {
pkg_free(buf);
goto out_clear_err;
}
Expand Down

0 comments on commit 958a4df

Please sign in to comment.