|
|
fbe740 |
From a271a6a71073253a7dde518a63d5ee4965ee53d8 Mon Sep 17 00:00:00 2001
|
|
|
fbe740 |
Message-Id: <a271a6a71073253a7dde518a63d5ee4965ee53d8@dist-git>
|
|
|
fbe740 |
From: Jiri Denemark <jdenemar@redhat.com>
|
|
|
fbe740 |
Date: Tue, 26 May 2020 10:59:05 +0200
|
|
|
fbe740 |
Subject: [PATCH] cpu_x86: Use glib allocation in virCPUx86GetModels
|
|
|
fbe740 |
MIME-Version: 1.0
|
|
|
fbe740 |
Content-Type: text/plain; charset=UTF-8
|
|
|
fbe740 |
Content-Transfer-Encoding: 8bit
|
|
|
fbe740 |
|
|
|
fbe740 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
(cherry picked from commit e43e2ff7f5b629f979e56387c4be46f2be251b75)
|
|
|
fbe740 |
|
|
|
fbe740 |
https://bugzilla.redhat.com/show_bug.cgi?id=1840010
|
|
|
fbe740 |
|
|
|
fbe740 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
fbe740 |
Message-Id: <1d1d9c9b60f1ea44a2252cb2fbfbf3886ecd245f.1590483392.git.jdenemar@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
---
|
|
|
fbe740 |
src/cpu/cpu_x86.c | 10 +---------
|
|
|
fbe740 |
1 file changed, 1 insertion(+), 9 deletions(-)
|
|
|
fbe740 |
|
|
|
fbe740 |
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
|
|
|
fbe740 |
index 3711e03b3f..48f36c2bfc 100644
|
|
|
fbe740 |
--- a/src/cpu/cpu_x86.c
|
|
|
fbe740 |
+++ b/src/cpu/cpu_x86.c
|
|
|
fbe740 |
@@ -3121,21 +3121,13 @@ virCPUx86GetModels(char ***models)
|
|
|
fbe740 |
return -1;
|
|
|
fbe740 |
|
|
|
fbe740 |
if (models) {
|
|
|
fbe740 |
- if (VIR_ALLOC_N(*models, map->nmodels + 1) < 0)
|
|
|
fbe740 |
- goto error;
|
|
|
fbe740 |
+ *models = g_new0(char *, map->nmodels + 1);
|
|
|
fbe740 |
|
|
|
fbe740 |
for (i = 0; i < map->nmodels; i++)
|
|
|
fbe740 |
(*models)[i] = g_strdup(map->models[i]->name);
|
|
|
fbe740 |
}
|
|
|
fbe740 |
|
|
|
fbe740 |
return map->nmodels;
|
|
|
fbe740 |
-
|
|
|
fbe740 |
- error:
|
|
|
fbe740 |
- if (models) {
|
|
|
fbe740 |
- virStringListFree(*models);
|
|
|
fbe740 |
- *models = NULL;
|
|
|
fbe740 |
- }
|
|
|
fbe740 |
- return -1;
|
|
|
fbe740 |
}
|
|
|
fbe740 |
|
|
|
fbe740 |
|
|
|
fbe740 |
--
|
|
|
fbe740 |
2.26.2
|
|
|
fbe740 |
|