conf: use VIR_APPEND_ELEMENT in virDomainDefAddImplicitVideo

This commit is contained in:
Ján Tomko 2016-04-11 15:28:29 +02:00
parent 1485be1784
commit 1278688921

View File

@ -18663,10 +18663,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: