mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
xenParseXMDisk: Use automatic memory clearing and remove 'ret' variable
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
a31864e60a
commit
18e65eef04
@ -238,9 +238,9 @@ xenParseXMDisk(char *entry, int hvm)
|
||||
static int
|
||||
xenParseXMDiskList(virConf *conf, virDomainDef *def)
|
||||
{
|
||||
char **disks = NULL, **entries;
|
||||
g_auto(GStrv) disks = NULL;
|
||||
GStrv entries;
|
||||
int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
|
||||
int ret = -1;
|
||||
int rc;
|
||||
|
||||
rc = virConfGetValueStringList(conf, "disk", false, &disks);
|
||||
@ -258,10 +258,7 @@ xenParseXMDiskList(virConf *conf, virDomainDef *def)
|
||||
VIR_APPEND_ELEMENT(def->disks, def->ndisks, disk);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
g_strfreev(disks);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user