[PATCH 01/22] conf: Use VIR_AUTO* in virDomainCapsCPUModelsAdd

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/conf/domain_capabilities.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 1000d8b969..37e767d5c9 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -246,25 +246,20 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
                           virDomainCapsCPUUsable usable,
                           char **blockers)
 {
-    char *nameCopy = NULL;
-    char **blockersCopy = NULL;
+    VIR_AUTOFREE(char *) nameCopy = NULL;
+    VIR_AUTOSTRINGLIST blockersCopy = NULL;
 
     if (VIR_STRNDUP(nameCopy, name, nameLen) < 0)
-        goto error;
+        return -1;
 
     if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0)
-        goto error;
+        return -1;
 
     if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy,
                                        usable, &blockersCopy) < 0)
-        goto error;
+        return -1;
 
     return 0;
-
- error:
-    VIR_FREE(nameCopy);
-    virStringListFree(blockersCopy);
-    return -1;
 }
 
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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