[PATCH v3 03/52] 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>
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>
---

Notes:
    Version 2:
    - no change
    
    Version 3:
    - g_autofree

 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 09bf047647..e92df9e9da 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -242,25 +242,20 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
                           virDomainCapsCPUUsable usable,
                           char **blockers)
 {
-    char *nameCopy = NULL;
-    char **blockersCopy = NULL;
+    g_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