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

[libvirt PATCH v2 1/8] cpu_ppc64: Use g_auto* in ppc64MakeCPUData



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

diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 28fbfea9ae..c0d09db696 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -399,7 +399,7 @@ static virCPUDataPtr
 ppc64MakeCPUData(virArch arch,
                  virCPUppc64Data *data)
 {
-    virCPUDataPtr cpuData;
+    g_autoptr(virCPUData) cpuData = NULL;
 
     if (VIR_ALLOC(cpuData) < 0)
         return NULL;
@@ -407,9 +407,9 @@ ppc64MakeCPUData(virArch arch,
     cpuData->arch = arch;
 
     if (ppc64DataCopy(&cpuData->data.ppc64, data) < 0)
-        VIR_FREE(cpuData);
+        return NULL;
 
-    return cpuData;
+    return g_steal_pointer(&cpuData);
 }
 
 static virCPUCompareResult
-- 
2.26.2


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