[sr-dev] git:mgw/free_faked_req: tm: fix memory leak in free_faked_req

Matthew Williams matthew at flowroute.com
Fri Aug 9 01:49:25 CEST 2013


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!

-- 
Matthew Williams
Flowroute LLC
Web: www.flowroute.com

On Thu, Aug 8, 2013 at 7:43 PM, Matthew Williams <matthew at flowroute.com> wrote:
> 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=f326b3070d8af8f84b3b9b077e029d43ec7f7000
>
> Author: Matthew Williams <mgwilliams at gmail.com>
> Committer: Matthew Williams <mgwilliams at 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) );
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev



More information about the sr-dev mailing list