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

[libvirt PATCH 10/15] cpu_ppc64: Use g_auto* in ppc64LoadMap



Signed-off-by: Tim Wiederhake <twiederh redhat com>
---
 src/cpu/cpu_ppc64.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 44420c9cd5..7b34fe6bbc 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -384,19 +384,15 @@ ppc64ModelParse(xmlXPathContextPtr ctxt,
 static ppc64_map *
 ppc64LoadMap(void)
 {
-    ppc64_map *map;
+    g_autoptr(ppc64_map) map = NULL;
 
     if (VIR_ALLOC(map) < 0)
-        goto error;
+        return NULL;
 
     if (cpuMapLoad("ppc64", ppc64VendorParse, NULL, ppc64ModelParse, map) < 0)
-        goto error;
-
-    return map;
+        return NULL;
 
- error:
-    ppc64MapFree(map);
-    return NULL;
+    return g_steal_pointer(&map);
 }
 
 static virCPUDataPtr
-- 
2.26.2


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