[PATCH -ocserv 5/5] config: Use talloc_free() to free "route" strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Applied all except (4) which I commented on. Thanks!

On Mon, Feb 9, 2015 at 2:26 AM, Kevin Cernekee <cernekee at gmail.com> wrote:
> Adding redundant routes triggers a glibc assertion on startup.  The offending
> config file contained:
>
>     route = 192.168.1.0/255.255.255.0
>     route = default
>
> The assertion:
>
>     # ./src/ocserv -c ocserv.conf -f
>     *** Error in `./src/ocserv': munmap_chunk(): invalid pointer: 0x0000000001703470 ***
>     Aborted (core dumped)
>
> Fix this by calling the correct free() function.
> ---
>  src/config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/config.c b/src/config.c
> index 9ce93a1..4559688 100644
> --- a/src/config.c
> +++ b/src/config.c
> @@ -718,7 +718,7 @@ unsigned force_cert_auth;
>                     strcmp(config->network.routes[j], "default") == 0) {
>                         /* set default route */
>                         for (i=0;i<j;i++)
> -                               free(config->network.routes[i]);
> +                               talloc_free(config->network.routes[i]);
>                         config->network.routes_size = 0;
>                         break;
>                 }
> --
> 1.9.1
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux