keep a copy of ``urecord`` if mode is DB_ONLY as it is static preventing leaking ``ucontact`` to shared memory
See #997 for details You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1000
-- Commit Summary --
* usrloc: fix ucontact shared leak
-- File Changes --
M src/modules/usrloc/ucontact.c (13) M src/modules/usrloc/urecord.c (35)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1000.patch https://github.com/kamailio/kamailio/pull/1000.diff
miconda commented on this pull request.
@@ -1672,6 +1672,7 @@ static inline int update_contact_db(ucontact_t* _c)
*/ int update_ucontact(struct urecord* _r, ucontact_t* _c, ucontact_info_t* _ci) { + static struct urecord _ur;
I don't see a reason to declare the variable _ur static here or in the other cases of the patch. It does not seem to be used outside of the function, so it can be declared locally (on the stack).
Besides my remark with the static variable, I'm ok to get the PR merged and backported. Thanks.
Merged #1000.