From 0b261edd15472557170bb032b7dfd4358084f3a4 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Wed, 9 Sep 2020 08:37:51 +0200 Subject: [PATCH] cpu_ppc64: Remove error path in virCPUppc64DriverGetModels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The call to `g_strfreev` is not required, as in both cases no memory has been allocated. Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- src/cpu/cpu_ppc64.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 9e6f1e856e..28fbfea9ae 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -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 = {