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

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 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




[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