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

Pavel Hrdina phrdina at redhat.com
Fri Jan 29 18:22:12 UTC 2021


On Fri, Jan 29, 2021 at 07:08:27PM +0100, Peter Krempa wrote:
> 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.

I guess this is my mistake in the meson rewrite. Specifically commit
8fe8df4b2026ca21db123ddc0cdd8451a2e224dd where originally it did not
link to anything but with meson it now can link with a lot of libraries
specified in tests_dep. That probably needs to be fixed to make it work
as expected.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210129/b465e4fc/attachment-0001.sig>


More information about the libvir-list mailing list