Skip to content

Commit

Permalink
b2b_sdp_demux: fix possible invalid memory access
Browse files Browse the repository at this point in the history
Prevent free-then-use error when b2b_key cannot be copied in shm.

Thanks go to Suchi Sahoo from Five9 for reporting it
  • Loading branch information
razvancrainea committed Aug 23, 2022
1 parent 60043ae commit d908564
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/b2b_sdp_demux/b2b_sdp_demux.c
Expand Up @@ -1645,8 +1645,8 @@ static int b2b_sdp_demux_start(struct sip_msg *msg, str *uri,
if (shm_str_dup(&client->b2b_key, b2b_key) < 0) {
LM_ERR("could not copy b2b client key\n");
/* key is not yet stored, but INVITE sent - terminate it */
pkg_free(b2b_key);
b2b_sdp_client_terminate(client, b2b_key);
pkg_free(b2b_key);
return -1;
}
pkg_free(b2b_key);
Expand Down

0 comments on commit d908564

Please sign in to comment.