From 0d23250a5e8f3193c1052e77c86a872020fea597 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 6 May 2019 11:20:00 +0200 Subject: [PATCH] usrloc: udomain_contact_expired_cb fix memory leak We need to call release_urecord in order to free the ucontacts generated at get_urecord() on shared memory --- src/modules/usrloc/udomain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/usrloc/udomain.c b/src/modules/usrloc/udomain.c index c28c881790a..11378aadeec 100644 --- a/src/modules/usrloc/udomain.c +++ b/src/modules/usrloc/udomain.c @@ -1019,7 +1019,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) if ( (c=mem_insert_ucontact(r, &contact, ci)) == 0) { LM_ERR("inserting contact failed\n"); - free_ucontact(c); + release_urecord(r); unlock_udomain(_d, &user); goto error; } @@ -1029,7 +1029,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d) run_ul_callbacks( UL_CONTACT_EXPIRE, c); } c->state = CS_SYNC; - free_ucontact(c); + release_urecord(r); unlock_udomain(_d, &user); }