[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt PATCH 11/21] util: Use glib memory functions in virDevMapperGetTargetsImpl



Signed-off-by: Tim Wiederhake <twiederh redhat com>
---
 src/util/virdevmapper.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c
index 7c89c2a952..4d27c9f104 100644
--- a/src/util/virdevmapper.c
+++ b/src/util/virdevmapper.c
@@ -260,9 +260,7 @@ virDevMapperGetTargetsImpl(int controlFD,
         return -1;
     }
 
-    if (VIR_ALLOC_N_QUIET(devPaths, deps->count + 1) < 0)
-        return -1;
-
+    devPaths = g_new0(char *, deps->count + 1);
     for (i = 0; i < deps->count; i++) {
         devPaths[i] = g_strdup_printf("/dev/block/%u:%u",
                                       major(deps->dev[i]),
-- 
2.26.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]