From: Tim Wiederhake Date: Tue, 11 Jan 2022 16:54:56 +0000 (+0100) Subject: conf: interface: Preparation for g_auto X-Git-Tag: v8.1.0-rc1~471 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77eb77ef4ac6dc09959c2f69762fb154b6c53a8b;p=thirdparty%2Flibvirt.git conf: interface: Preparation for g_auto These changes make the g_auto-ification in the next commit clearer. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 150616bda9..cbe6aad957 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -453,14 +453,12 @@ virInterfaceDefParseIfAdressing(virInterfaceDef *def, } proto->family = tmp; if (STREQ(tmp, "ipv4")) { - ret = virInterfaceDefParseProtoIPv4(proto, ctxt); - if (ret != 0) { + if (virInterfaceDefParseProtoIPv4(proto, ctxt) != 0) { virInterfaceProtocolDefFree(proto); goto error; } } else if (STREQ(tmp, "ipv6")) { - ret = virInterfaceDefParseProtoIPv6(proto, ctxt); - if (ret != 0) { + if (virInterfaceDefParseProtoIPv6(proto, ctxt) != 0) { virInterfaceProtocolDefFree(proto); goto error; } @@ -741,10 +739,12 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, } switch (type) { - case VIR_INTERFACE_TYPE_ETHERNET: - if ((tmp = virXPathString("string(./mac/@address)", ctxt))) - def->mac = tmp; + case VIR_INTERFACE_TYPE_ETHERNET: { + char *mac = virXPathString("string(./mac/@address)", ctxt); + if (mac != NULL) + def->mac = mac; break; + } case VIR_INTERFACE_TYPE_BRIDGE: { xmlNodePtr bridge;