mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
cpu_ppc64: Remove error path in virCPUppc64DriverGetModels
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>
This commit is contained in:
parent
239218c567
commit
0b261edd15
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user