Menu

#247 possible memory leak in serialize.c

1.6.x
closed-fixed
core (110)
5
2010-01-22
2010-01-18
No

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.

Discussion

  • Richard Revels

    Richard Revels - 2010-01-19

    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.

     
  • Bogdan-Andrei Iancu

    • assigned_to: nobody --> bogdan_iancu
     
  • Bogdan-Andrei Iancu

    mem leak fix

     
  • Bogdan-Andrei Iancu

    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

     
  • Bogdan-Andrei Iancu

    • status: open --> open-fixed
     
  • Nobody/Anonymous

    The patch has fixed the issue for us. We are no longer able to detect any memory leakage at all.

     
  • Bogdan-Andrei Iancu

    patch uploaded on SVN

     
  • Bogdan-Andrei Iancu

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.