[master] e95760818 vtest: plug insignificant leak

Dridi Boukelmoune dridi at varni.sh
Tue Jan 12 19:04:55 UTC 2021


On Sun, Jan 10, 2021 at 4:56 PM Nils Goroll <nils.goroll at uplex.de> wrote:
>
>
> commit e95760818552ba954d3750638c0b084ee4879214
> Author: Nils Goroll <nils.goroll at uplex.de>
> Date:   Sun Jan 10 17:54:07 2021 +0100
>
>     vtest: plug insignificant leak
>
>     introduced with 1c19f3fed3da8fae79ef200f2ebf01625a42bb27
>
>     CID 1471724
>
>     Ref #3490

This patch fails 100% of our VTCs on macos.

> diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
> index 9b5a60a25..fa7524c2d 100644
> --- a/bin/varnishtest/vtc_main.c
> +++ b/bin/varnishtest/vtc_main.c
> @@ -585,6 +585,7 @@ ip_magic(void)
>         struct suckaddr *sa;
>         char abuf[VTCP_ADDRBUFSIZE];
>         char pbuf[VTCP_PORTBUFSIZE];
> +       char *s;
>
>         /*
>          * In FreeBSD jails localhost/127.0.0.1 becomes the jails IP#
> @@ -622,10 +623,13 @@ ip_magic(void)
>                 extmacro_def("bad_backend", "[%s]:%s", abuf, pbuf);
>
>         /* our default bind/listen address */
> +       s = macro_get("localhost", NULL);
> +       AN(s);
>         if (VSA_Get_Proto(sa) == AF_INET)
> -               bprintf(abuf, "%s:0", macro_get("localhost", NULL));
> +               bprintf(abuf, "%s:0", s);
>         else
> -               bprintf(abuf, "[%s]:0", macro_get("localhost", NULL));
> +               bprintf(abuf, "[%s]:0", s);
> +       free(s);
>
>         extmacro_def("listen_addr", "%s", abuf);
>         default_listen_addr = strdup(abuf);
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit


More information about the varnish-commit mailing list