From: Ján Tomko Date: Mon, 11 Apr 2016 13:28:29 +0000 (+0200) Subject: conf: use VIR_APPEND_ELEMENT in virDomainDefAddImplicitVideo X-Git-Tag: v1.3.3.2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d460558ea808d9394c27526f1259f50a6d210c98;p=thirdparty%2Flibvirt.git conf: use VIR_APPEND_ELEMENT in virDomainDefAddImplicitVideo (cherry picked from commit 1278688921b5721b6b9af63899fad0310f63b979) --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 364615a915..f76fd07484 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18585,10 +18585,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: