Skip to content

Commit

Permalink
siprec: Fix invalid READ operation on freed memory
Browse files Browse the repository at this point in the history
Also tidy up the cleanup phase

Thanks to Rob Moore, Daniel Bryars and Steven Ayre from Dubber for
reporting it and providing valuable information for troubleshooting!

(cherry picked from commit 9996f9f)
  • Loading branch information
liviuchircu committed Aug 31, 2023
1 parent 6e9f821 commit b69d8c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/siprec/siprec_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,14 @@ void srec_logic_destroy(struct src_sess *sess)
{
if (!sess->b2b_key.s)
return;
shm_free(sess->b2b_key.s);

srec_b2b.entity_delete(B2B_CLIENT, &sess->b2b_key, sess->dlginfo, 1, 1);
if (sess->dlginfo)
if (sess->dlginfo) {
shm_free(sess->dlginfo);
sess->dlginfo = NULL;
}

shm_free(sess->b2b_key.s);
sess->b2b_key.s = NULL;
}

0 comments on commit b69d8c5

Please sign in to comment.