util: Use glib memory functions in virDevMapperGetTargetsImpl

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:
Tim Wiederhake 2020-09-11 13:42:08 +02:00 committed by Ján Tomko
parent 85e4418502
commit e5c2b25075

View File

@ -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]),