mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
domain_conf: use g_renew in virDomainDiskInsert() and virDomainControllerInsert()
Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8f80014299
commit
81e91f6a93
@ -17685,8 +17685,7 @@ virDomainDiskByTarget(virDomainDefPtr def,
|
||||
int virDomainDiskInsert(virDomainDefPtr def,
|
||||
virDomainDiskDefPtr disk)
|
||||
{
|
||||
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
|
||||
return -1;
|
||||
def->disks = g_renew(virDomainDiskDefPtr, def->disks, def->ndisks + 1);
|
||||
|
||||
virDomainDiskInsertPreAlloced(def, disk);
|
||||
|
||||
@ -18093,8 +18092,7 @@ virDomainNetARPInterfaces(virDomainDefPtr def,
|
||||
int virDomainControllerInsert(virDomainDefPtr def,
|
||||
virDomainControllerDefPtr controller)
|
||||
{
|
||||
if (VIR_REALLOC_N(def->controllers, def->ncontrollers+1) < 0)
|
||||
return -1;
|
||||
def->controllers = g_renew(virDomainControllerDefPtr, def->controllers, def->ncontrollers + 1);
|
||||
|
||||
virDomainControllerInsertPreAlloced(def, controller);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user