Re: [PATCH] conf: convert network_conf.c to use g_auto* pointers

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

 



On Wed, Jun 10, 2020 at 12:16:50AM -0400, Laine Stump wrote:
> This was mostly boilerplate conversion, but in one case I needed to
> define several differently named char* to take the place of a single
> char *tmp that was re-used multiple times, and in another place there
> was a single char* that was used at the toplevel of the function, and
> then later used repeatedly inside a for loop, so I defined a new
> separate char* inside the loop.
> 
> Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
> ---
> 
> This should be applied on top of Dan's IPv6 NAT patch series (it was
> reviewing that series that showed me this file hadn't yet been
> converted).

...

> @@ -689,14 +678,12 @@ virNetworkDHCPDefParseXML(const char *networkName,
>  
>              if (server &&
>                  virSocketAddrParse(&inaddr, server, AF_UNSPEC) < 0) {
> -                VIR_FREE(file);
> -                VIR_FREE(server);
>                  goto cleanup;
>              }
>  
>              def->bootfile = file;
> +            file = NULL;

g_steal_pointer would do as well

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux