We have been chasing what appears to be a memory leak in opensips-1.6.1-notls. We believe that in serialize_branches line 154 enc_info is being allocated but is not being freed in all cases. We will continue tracking this but wanted to get it out where other eyes could look into it as well.
To add to this, we think enc_info gets malloc'd. Then contacts[i].enc_info is set to that pointer. Then val.s is also set to that pointer. Next val is used in a call to add_avp for serial_avp. This malloc's and copies the data from val. val is left hanging on exit from serialize_branches and if the pointer is freed from the contacts structure, we haven't found that yet.
mem leak fix
Hi Richard,
Indeed there was a mem leak there - could you test the attached patch? it should fix the problem. If ok, I will upload the patch on SVN.
Thanks and regards,
Bogdan
The patch has fixed the issue for us. We are no longer able to detect any memory leakage at all.
patch uploaded on SVN