Signed-off-by: Jiri Denemark <jdene...@redhat.com>
Reviewed-by: Ján Tomko <jto...@redhat.com>
---

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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to