[OpenSER-Devel] Memory leak in get_route_set

Tiberius Duluman tiberius.duluman at iquestint.com
Fri Dec 7 12:03:56 UTC 2007


I've noticed a memory in leak in shared memory when a dlg_t is
updated using dlg_response_uac from a response that contains
a Record-Route header with more than one route.

N address=0xb5f5fb7c frag=0xb5f5fb64 size=76 used=1
  alloc'd from parser/parse_rr.c: do_duplicate_rr(280)
  start check=f0f0f0f0, end check= c0c0c0c0, abcdefed

After investigating, I have found that get_route_set is iterating through
each Record-Route header, and for each rr_t element in a Record-Route,
it calls the shm_duplicate_rr ( that calls do_duplicate_rr )

The comment of do_duplicate_rr claims that it duplicates only a single rr_t
structure, but if you look on the code, you will easily note that the entire
linked list starting with passed rr_t is duplicated. Also, a comment in
the beginning of the file claims that:

2003-10-21  duplicate_rr() duplicate the whole linked list of RR

How does this problem can be solved? Should do_duplicate_rr function
duplicate only a single rr_t?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openser.org/pipermail/devel/attachments/20071207/54600fdd/attachment.htm 


More information about the Devel mailing list