mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
prlsdkAddDomainVideoInfoCt: Remove pointless cleanup section
'video' will only ever be NULL after the 'cleanup' label thus there's no need to use 'virDomainVideoDefFree'. In fact we can fully remove the cleanup section and 'ret' variable by returning directly from failure points. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
f90de01763
commit
a31864e60a
@ -542,24 +542,19 @@ prlsdkAddDomainVideoInfoCt(virDomainDef *def,
|
||||
virDomainXMLOption *xmlopt)
|
||||
{
|
||||
virDomainVideoDef *video = NULL;
|
||||
int ret = -1;
|
||||
|
||||
if (def->ngraphics == 0)
|
||||
return 0;
|
||||
|
||||
if (!(video = virDomainVideoDefNew(xmlopt)))
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
video->type = VIR_DOMAIN_VIDEO_TYPE_PARALLELS;
|
||||
video->vram = 0;
|
||||
|
||||
VIR_APPEND_ELEMENT(def->videos, def->nvideos, video);
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virDomainVideoDefFree(video);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
x
Reference in New Issue
Block a user