Module: kamailio
Branch: master
Commit: 48fd1a23cc3ddcb0df082bc24669dbf3a9fdc203
URL:
https://github.com/kamailio/kamailio/commit/48fd1a23cc3ddcb0df082bc24669dbf…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2019-05-07T09:27:42+02:00
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
---
Modified: src/modules/usrloc/udomain.c
---
Diff:
https://github.com/kamailio/kamailio/commit/48fd1a23cc3ddcb0df082bc24669dbf…
Patch:
https://github.com/kamailio/kamailio/commit/48fd1a23cc3ddcb0df082bc24669dbf…
---
diff --git a/src/modules/usrloc/udomain.c b/src/modules/usrloc/udomain.c
index c28c881790..11378aadee 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);
}