mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +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,
|
int virDomainDiskInsert(virDomainDefPtr def,
|
||||||
virDomainDiskDefPtr disk)
|
virDomainDiskDefPtr disk)
|
||||||
{
|
{
|
||||||
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
|
def->disks = g_renew(virDomainDiskDefPtr, def->disks, def->ndisks + 1);
|
||||||
return -1;
|
|
||||||
|
|
||||||
virDomainDiskInsertPreAlloced(def, disk);
|
virDomainDiskInsertPreAlloced(def, disk);
|
||||||
|
|
||||||
@ -18093,8 +18092,7 @@ virDomainNetARPInterfaces(virDomainDefPtr def,
|
|||||||
int virDomainControllerInsert(virDomainDefPtr def,
|
int virDomainControllerInsert(virDomainDefPtr def,
|
||||||
virDomainControllerDefPtr controller)
|
virDomainControllerDefPtr controller)
|
||||||
{
|
{
|
||||||
if (VIR_REALLOC_N(def->controllers, def->ncontrollers+1) < 0)
|
def->controllers = g_renew(virDomainControllerDefPtr, def->controllers, def->ncontrollers + 1);
|
||||||
return -1;
|
|
||||||
|
|
||||||
virDomainControllerInsertPreAlloced(def, controller);
|
virDomainControllerInsertPreAlloced(def, controller);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user