[libvirt PATCH 12/13] conf: use g_new0

Erik Skultety eskultet at redhat.com
Thu Oct 8 08:04:07 UTC 2020


> diff --git a/src/conf/virnetworkportdef.c b/src/conf/virnetworkportdef.c
> index 1db3dc69e2..3183078195 100644
> --- a/src/conf/virnetworkportdef.c
> +++ b/src/conf/virnetworkportdef.c
> @@ -95,8 +95,8 @@ virNetworkPortDefParseXML(xmlXPathContextPtr ctxt)
>      g_autofree char *managed = NULL;
>      g_autofree char *driver = NULL;
>  
> -    if (VIR_ALLOC(def) < 0)
> -        return NULL;
> +    def = g_new0(virNetworkPortDef,
> +                 1);

Make ^these a single line.




More information about the libvir-list mailing list