[PATCH 7/7] conf: use VIR_APPEND_ELEMENT in virDomainDefAddImplicitVideo

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

 



---
 src/conf/domain_conf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7d48517..f9c6bcc 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18662,10 +18662,8 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def)
     }
     video->vram = virDomainVideoDefaultRAM(def, video->type);
     video->heads = 1;
-    if (VIR_ALLOC_N(def->videos, 1) < 0)
+    if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, video) < 0)
         goto cleanup;
-    def->videos[def->nvideos++] = video;
-    video = NULL;
 
     ret = 0;
  cleanup:
-- 
2.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]