Module: kamailio
Branch: 5.2
Commit: 75f743d9501faaead7a173c8f459d4b2adfcb41d
URL: 
https://github.com/kamailio/kamailio/commit/75f743d9501faaead7a173c8f459d4b2adfcb41d

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2019-05-07T09:29:45+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

(cherry picked from commit 48fd1a23cc3ddcb0df082bc24669dbf3a9fdc203)

---

Modified: src/modules/usrloc/udomain.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/75f743d9501faaead7a173c8f459d4b2adfcb41d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/75f743d9501faaead7a173c8f459d4b2adfcb41d.patch

---

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);
                }
 


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to