]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu_ppc64: Remove error path in virCPUppc64DriverGetModels
authorTim Wiederhake <twiederh@redhat.com>
Wed, 9 Sep 2020 06:37:51 +0000 (08:37 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 9 Sep 2020 06:44:22 +0000 (08:44 +0200)
The call to `g_strfreev` is not required, as in both cases no memory has been allocated.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/cpu/cpu_ppc64.c

index 9e6f1e856ea653ec1780ee2ef5d80779bca40ab9..28fbfea9aec4fde82ab475cfcaa2f617101db67b 100644 (file)
@@ -738,24 +738,17 @@ virCPUppc64DriverGetModels(char ***models)
     size_t i;
 
     if (!(map = ppc64LoadMap()))
-        goto error;
+        return -1;
 
     if (models) {
         if (VIR_ALLOC_N(*models, map->nmodels + 1) < 0)
-            goto error;
+            return -1;
 
         for (i = 0; i < map->nmodels; i++)
             (*models)[i] = g_strdup(map->models[i]->name);
     }
 
     return map->nmodels;
-
- error:
-    if (models) {
-        g_strfreev(*models);
-        *models = NULL;
-    }
-    return -1;
 }
 
 struct cpuArchDriver cpuDriverPPC64 = {