conf: use VIR_APPEND_ELEMENT in virDomainDefAddImplicitVideo

(cherry picked from commit 1278688921b5721b6b9af63899fad0310f63b979)
This commit is contained in:
Ján Tomko 2016-04-11 15:28:29 +02:00 committed by Cole Robinson
parent 24cf4c6476
commit d460558ea8

View File

@ -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: