mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
conf: Replace error label with cleanup in virDomainGraphicsDefParseVNCXML
Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
9f26814afd
commit
8ec7c8ce76
@ -13569,13 +13569,13 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0)
|
if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0)
|
||||||
goto error;
|
goto cleanup;
|
||||||
|
|
||||||
if (port) {
|
if (port) {
|
||||||
if (virStrToLong_i(port, NULL, 10, &def->data.vnc.port) < 0) {
|
if (virStrToLong_i(port, NULL, 10, &def->data.vnc.port) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse vnc port %s"), port);
|
_("cannot parse vnc port %s"), port);
|
||||||
goto error;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
/* Legacy compat syntax, used -1 for auto-port */
|
/* Legacy compat syntax, used -1 for auto-port */
|
||||||
if (def->data.vnc.port == -1) {
|
if (def->data.vnc.port == -1) {
|
||||||
@ -13604,7 +13604,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
|
|||||||
&def->data.vnc.websocket) < 0) {
|
&def->data.vnc.websocket) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse vnc WebSocket port %s"), websocket);
|
_("cannot parse vnc WebSocket port %s"), websocket);
|
||||||
goto error;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13616,7 +13616,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
|
|||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("unknown vnc display sharing policy '%s'"),
|
_("unknown vnc display sharing policy '%s'"),
|
||||||
sharePolicy);
|
sharePolicy);
|
||||||
goto error;
|
goto cleanup;
|
||||||
} else {
|
} else {
|
||||||
def->data.vnc.sharePolicy = policy;
|
def->data.vnc.sharePolicy = policy;
|
||||||
}
|
}
|
||||||
@ -13626,10 +13626,10 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
|
|||||||
|
|
||||||
if (virDomainGraphicsAuthDefParseXML(node, &def->data.vnc.auth,
|
if (virDomainGraphicsAuthDefParseXML(node, &def->data.vnc.auth,
|
||||||
def->type) < 0)
|
def->type) < 0)
|
||||||
goto error;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
error:
|
cleanup:
|
||||||
VIR_FREE(port);
|
VIR_FREE(port);
|
||||||
VIR_FREE(autoport);
|
VIR_FREE(autoport);
|
||||||
VIR_FREE(websocket);
|
VIR_FREE(websocket);
|
||||||
|
Loading…
Reference in New Issue
Block a user