Module: sip-router Branch: mgw/free_faked_req Commit: f326b3070d8af8f84b3b9b077e029d43ec7f7000 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f326b307...
Author: Matthew Williams mgwilliams@gmail.com Committer: Matthew Williams mgwilliams@gmail.com Date: Thu Aug 8 16:43:08 2013 -0700
tm: fix memory leak in free_faked_req
---
modules/tm/t_reply.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c index 97b813f..ce1301a 100644 --- a/modules/tm/t_reply.c +++ b/modules/tm/t_reply.c @@ -973,6 +973,11 @@ void free_faked_req(struct sip_msg *faked_req, struct cell *t) faked_req->dst_uri.s = 0; }
+ if (faked_req->path_vec.s) { + pkg_free(faked_req->path_vec.s); + faked_req->path_vec.len=0; + } + /* free all types of lump that were added in failure handlers */ del_nonshm_lump( &(faked_req->add_rm) ); del_nonshm_lump( &(faked_req->body_lumps) );
HI Daniel et al,
I've not previously committed anything to master, so I've pushed this to a branch for review.
We were performing a registration lookup from within an async route. Since async routes use a faked request, the path_vec member was not getting freed.
Please let me know if this looks good to push to master.
Thanks!
Hello,
On 8/9/13 1:49 AM, Matthew Williams wrote:
HI Daniel et al,
I've not previously committed anything to master, so I've pushed this to a branch for review.
We were performing a registration lookup from within an async route. Since async routes use a faked request, the path_vec member was not getting freed.
Please let me know if this looks good to push to master.
few more things should be cared of: - that path_vec is not already set from the shared memory, resulting in pkg free for a shm pointer - path_vec is an old attribute, but same situation might apply for the last added attributes in sip_msg structure related to location lookup, such as ruid, instance, user agent
So either they are cloned in pkg when faked msg is built (like new uri and st uri) or set to null and freed in fake msg free function if they are not null. Cheers, Daniel