[libvirt PATCH 17/19] commandhelper: Convert printEnvironment to g_auto*

Peter Krempa pkrempa at redhat.com
Fri Jan 29 18:08:27 UTC 2021


On Fri, Jan 29, 2021 at 17:16:27 +0100, Tim Wiederhake wrote:
> Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
> ---
>  tests/commandhelper.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/commandhelper.c b/tests/commandhelper.c
> index e616f92987..26a7de5149 100644
> --- a/tests/commandhelper.c
> +++ b/tests/commandhelper.c
> @@ -108,16 +108,15 @@ static int envsort(const void *a, const void *b)
>  
>  static int printEnvironment(FILE *log)
>  {
> -    char **newenv;
> +    g_autofree char **newenv = NULL;

Per discussion on 4/19, this isn't allowed to link to glib, thus
g_autofree should not work as it uses g_free internally.




More information about the libvir-list mailing list