[sr-dev] [kamailio] ims_usrloc_scscf: fix link_contact_to_impu() - was crashing with maxcontact_behaviour == 2 (#512)

Dragos Oancea notifications at github.com
Tue Feb 16 19:17:32 CET 2016


link_contact_to_impu() does not behave as intended - it will return immediately because ptr==contact .
This will lead to a crash when current contact is always different than the previous. 
To prevent this, I set ptr to 0 as it points to a chunk of freed memory anyway.
Removed call to  unlink_contact_from_impu() as I believed is redundant and it leads to double free.
This is an usual scenario and it happens with devices that reconnect on TCP , and they change the src port every time , and then the contact will be different. 


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/512

-- Commit Summary --

  * ims_usrloc_scscf: fix link_contact_to_impu() (was crashing when maxcontact_behaviour == 2)

-- File Changes --

    M modules/ims_usrloc_scscf/impurecord.c (4)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/512.patch
https://github.com/kamailio/kamailio/pull/512.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/512
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160216/184c266a/attachment-0001.html>


More information about the sr-dev mailing list