diff --git a/modules/siprec/siprec_logic.c b/modules/siprec/siprec_logic.c index e314316c1d7..84911f0054d 100644 --- a/modules/siprec/siprec_logic.c +++ b/modules/siprec/siprec_logic.c @@ -646,14 +646,19 @@ void srec_logic_destroy(struct src_sess *sess) { if (!sess->b2b_key.s) return; - shm_free(sess->b2b_key.s); - if (sess->initial_sdp.s) + if (sess->initial_sdp.s) { shm_free(sess->initial_sdp.s); + sess->initial_sdp.s = NULL; + } 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; sess->flags &= ~SIPREC_STARTED;