Hi Godbach,

On Wed, Oct 02, 2013 at 05:30:12PM +0800, Godbach wrote:
> Hi Willy,
> 
> There is a patch for freeing server map while doing cleanup.
> 
> Please check the attatchment for your information.
> 
> The commit log is as below:
> Both static-rr and hash with type map-based call init_server_map() to
> allocate
> server map, so the server map should be freed while doing cleanup if one of
> the above load balance algorithms is used.

OK. Just for your info, the "if" before the free() is not needed
because free() already does it, so I'll remove it.

> diff --git a/src/haproxy.c b/src/haproxy.c
> index ec9f513..265c39c 100644
> --- a/src/haproxy.c
> +++ b/src/haproxy.c
> @@ -975,6 +975,8 @@ void deinit(void)
>               free(p->conf.lfs_file);
>               free(p->conf.uniqueid_format_string);
>               free(p->conf.uif_file);
> +             if (p->lbprm.map.srv)
> +                     free(p->lbprm.map.srv);
>  
>               for (i = 0; i < HTTP_ERR_SIZE; i++)
>                       chunk_destroy(&p->errmsg[i]);
> -- 
> 1.7.7

Thanks,
Willy


Reply via email to